cancel
Showing results for 
Search instead for 
Did you mean: 

Ability to restrict visibility of custom action based on online or offline mode

AnkitaDua
Explorer
0 Kudos
305

Hi Team,

We had a requirement wherein, the custom action added on Sales Order TI screen was required to be hidden if user uses the order in offline mode whereas in online mode, the custom action should be made visible to the user for accessibility. Has anyone implemented such a scenario?


I tried using out a standard function of Context.IsOfflineUploadRunning() to verify whether the object is being used in offline or online mode. Based on the identification, an indicator was turn on or off to control the visibility. The function was defined in probable standard events - Root-AfterModify, Root-AfterModify-Offline, Root-BeforeSave, Root-BeforeSave-Offline.

However, this approach didn't worked in all scenarios. The reason being whenever the user switches from offline to online mode then Root-AfterModify or Root-BeforeSave gets triggered causing the indicator to turn on whereas the same for Root-AfterModify-Offline or Root-BeforeSave-Offline is not applicable when the user switches from online to offline. Since no event is triggered in such a case, the indicator value remains true/on leading to action visible in offline mode.

Please let me know in case there are any suggestions on how to fulfil this scenario.

Thanks & Regards

Ankita Dua

Accepted Solutions (0)

Answers (1)

Answers (1)

former_member226
Employee
Employee

Hello Ankita,

Why are you putting such logic in PDI to control the visibility of the button? Why you are not using the standard KUT Rule with the function "ISOFFLINE()"? I think this should resolve your issue?