- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-03-2024 09:20 AM
Hi Team
i want to hide UI action button on custom table form (U_incident) i am trying add add condition in UI action but the problem is already there are several conditions mentioned in that filed and that condition filed is full i am not able add my table name in that condition is there any other way to hide that button for my table can any one help me in the script or any other way
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-03-2024 09:26 PM
@shabbir9 Here is the script include code.
var UIActionConditionCheck = Class.create();
UIActionConditionCheck.prototype = {
initialize: function() {
},
checkConditions: function(current) {
return current.isValidRecord() &&
current.canWrite() &&
gs.getProperty('glide.ui.is_submit') != 'true' &&
current.sys_class_name != 'change_request' &&
current.sys_class_name != 'incident';
},
type: 'UIActionConditionCheck'
};
Here is how you should add condition in your condition field of UI Action.
new UIActionConditionCheck().checkConditions(current);
Hope this helps.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-03-2024 09:57 AM
@shabbir9 Except for the role (which you can specify using requires role field)UI Action condition field is the only way by which you can control the visibility of the UI Action. If your UI Action condition field is already full, then you can plan to shift the UI Action conditions to a script include and inside your script include you can add as many conditions as you want and return true/false from your script include function to show/hide the UI Action.
Here is an example of how you can call a script include method from the condition field in the UI Action.
Hope this answers your question.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-03-2024 08:51 PM
Hi @Sandeep Rajput Thank you for your reply could you please help me in the script include script my UI action condition is----current.isValidRecord() && current.canWrite() && gs.getProperty('glide.ui.is_submit') != 'true' && current.sys_class_name != 'change_request && current.sys_class_name != 'incident' How to add this condition in script include script could you please share sample script..

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-03-2024 09:26 PM
@shabbir9 Here is the script include code.
var UIActionConditionCheck = Class.create();
UIActionConditionCheck.prototype = {
initialize: function() {
},
checkConditions: function(current) {
return current.isValidRecord() &&
current.canWrite() &&
gs.getProperty('glide.ui.is_submit') != 'true' &&
current.sys_class_name != 'change_request' &&
current.sys_class_name != 'incident';
},
type: 'UIActionConditionCheck'
};
Here is how you should add condition in your condition field of UI Action.
new UIActionConditionCheck().checkConditions(current);
Hope this helps.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-03-2024 11:27 PM
Thank you so much for your help @Sandeep Rajput it helped me a lot