How can i hide list context menu based on condition not satisfied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-12-2018 11:43 AM
Hi,
I have created a custom UI Action -List context menu for a custom table. In this UI Action, I've provided a condition to the UI Action.
But when condition is not satisfied the List context menu, I can view list context menu action and when clicked I get the message "Security does not allow the execution of that action against the specified record".
Instead of displaying a message, I would like to hide the UI Action when the condition is not satisfied? How can I achieve it.
Thank you.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-14-2018 04:01 AM
Hi Indira,
There is a role condition in UI action. Try adding role and then see if it satisfies your requirement.
Please make Correct or Helpful.
Warm Regards
Santosh Kshirsagar
www.dxsherpa.com
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-03-2018 01:17 PM
Hi, have you had any luck with this question? I've been able to hide a button based on a selection on a form (not saving it) using an onChange example I found and have pasted below. But as you can easily see it's only good for 'BUTTON' options and not list context menu. Works perfectly, if there were only a 'LISTCONTEXTMENU' option instead of 'BUTTON'.
var items = $$('BUTTON').each(function(item){
g_form.addErrorMessage('items --- ' + item.innerHTML);
if(item.innerHTML.indexOf('Delete') > -1){
item.hide();
}
});
}
else {
var items2 = $$('BUTTON').each(function(item){
if(item.innerHTML.indexOf('Delete') > -1){
item.hide();
}
});
}
Thank you in advance.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-03-2018 04:29 PM
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-13-2020 09:28 PM
The image links are broken. Can you please help on how can we achieve it ?
Thank you