- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-19-2024 07:29 AM - edited 09-19-2024 07:35 AM
PFB Script include
var Test = Class.create();
Test.prototype = {
initialize: function() {
},
ApprovalNotCome : function (){
var arr =[];
var gr = new GlideRecord('sys_user');
gr.addEncodedQuery('roles=approver_user');
gr.query();
while (gr.next()) {
var gr1 = new GlideRecord('sysapproval_approver');
gr1.addQuery('approver.name', gr.getValue('name'));
gr1.query();
if (!gr1.next()) {
arr.push(gr.getValue('name'));
}
}
gs.log("my error - "+arr);
return arr;
},
type: 'Test'
};
and I am calling above script include like below - javascript: new global.Test().ApprovalNotCome();
but not able to get values in filter?? please help here
Thank in advance
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-19-2024 09:04 AM - edited 09-19-2024 09:05 AM
Hi @Sid_Takali ,
Got the the solution I just made Sandbox enabled to True on script include and then able to see records
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-19-2024 07:49 AM
Hi @Ganesh Palve The syntax seems ok, check if your Array returning correct users with approve_user who do not have any approval records.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-19-2024 07:55 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-19-2024 08:10 AM
Hi @Ganesh Palve try this javascript: new global.Test().ApprovalNotCome() not sure if it works or not. Without colon
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-19-2024 09:04 AM - edited 09-19-2024 09:05 AM
Hi @Sid_Takali ,
Got the the solution I just made Sandbox enabled to True on script include and then able to see records