Hide UI Action on the basis of certain conditons
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-27-2023 04:03 AM
I want to hide UI action on the basis of certain condition. I have written script include and I am calling that script include in UI action condition. It is not going in script include, I am not getting logs as well. Can anyone please help as it is not working as expected.
Script include :
var smdrsOlaScoringCompleted = Class.create();
smdrsOlaScoringCompleted.prototype = {
allowOlaScoring: function(current) {
gs.info("@@@checking my script include");
var inputOla = new GlideRecord('x_amspi_smdrs_app_input_ola');
inputOla.addQuery('number', current.sys_id);
inputOla.addQuery('active', 'true');
gs.info("@@@checking my script include 1");
inputOla.query();
while (inputOla.next()) {
gs.info("@@@checking my script include 2");
if (inputOla.frequency == 'Daily') {
gs.info("@@@checking my script include 3");
inputOla.addEncodedQuery('sys_created_onONToday@javascript:gs.beginningOfToday()@javascript:gs.endOfToday()^state=1^ORstate=2');
return "true";
}
}
},
type: 'smdrsOlaScoringCompleted'
};
UI Action :
15 REPLIES 15
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-28-2023 12:44 AM
What I would suggest is add one condition at a time and test if it works fine. Start with the Script Include calling first and then add other conditions one by one.