How to hide an UI Action from List Context menu based on condition

bala_sn
Kilo Expert

Hi,

I have created a custom UI Action (Form button + List context menu). In this UI Action, I've provided a condition to hide/show the UI Action.

The UI Action is hidden when the condition is not satisfied on the "Form". But in the   List context menu, the UI Action is still show.

When I do the action, I get the message "Security does not allow the execution of that action against that record".

Instead of showing the UI Action and displaying a message, is it possible to hide the UI Action when the condition is not satisfied?

The condition in the condition field is something like "current.field_name == 'value'".

More details about the UI Action:

Show insert - yes

Show update - yes

Client - no

Any clues? Thanks in advance for your help.

6 REPLIES 6

treycarroll
Giga Guru

Hi Balakumar,



I discovered the same thing independently.     This seems like a bug in the platform.     It is certainly a problem for the feature that I am creating.     Very strangely, that security message appears ANY time there is any value in the condition, even if it contains only commented out code.



Trey Carroll


Felipe Reis2
Giga Contributor

Hi,

If you are trying to use 'current', it is not possible. 

'The current object is not available for conditions on a list context menu (the List context menu check box is selected). Any use of current on these actions is ignored.' See more here...

But, you can create a Script Include and a function to validate it.
Something like this:


Function on Script Include
 

UI Action condition: new YourScriptInclude().canPropose(task_ci);

 

Hope this helps.

Regards

Felipe Reis