Need help with UI action visibility on multiple conditions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-28-2023 07:25 AM - edited 12-28-2023 07:28 AM
Need help with UI action visibility on multiple conditions
I have written script include and called that script include in UI action condition. it works fine if I give encoded query in in the below code on line number 6 which I have commented but it is not working in if condition.
Script include :

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-28-2023 07:32 AM
Hi,
What is your requirement?
When we use GlideRecord we should ass query before gr.query() statment.
var smdrsOlaScoringCompleted = Class.create();
smdrsOlaScoringCompleted.prototype = {
allowOlaScoring: function(sysid) {
var inputOla = new GlideRecord('x_amspi_smdrs_app_ola_score');
inputOla.addQuery('sys_id', sysid);
//inputOla.addEncodedQuery('frequency=Daily^score_number.dateONToday@javascript:gs.beginningOfToday()@javascript:gs.endOfToday()^frequency=Daily^score_number.state=2');
inputOla.query();
if (inputOla.next()) {
return 'true';
}
},
type: 'smdrsOlaScoringCompleted'
};
Add in encoded query inside if() is not required and it may throw an error.
Thanks
Anil Lande
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-28-2023 07:51 AM
I want to add it in if because I have multiple condition to check in if else loop