- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-20-2025 11:52 AM - edited 10-20-2025 01:41 PM
I am trying to return all approvals for a specific Catalog Item, i have the script working but i want to run when you select on a module in the navigation.
Here is my script:
var approvalTest = Class.create();
approvalTest.prototype = Object.extendsObject(AbstractAjaxProcessor, {
populateApprovals: function() {
var approvals = [];
var grApprovals = new GlideRecord('sysapproval_approver');
grApprovals.addQuery('state', 'requested');
grApprovals.query();
while (grApprovals.next()) {
var grRitm = new GlideRecord('sc_req_item');
grRitm.addQuery('active', true);
grRitm.addQuery('sys_id', grApprovals.sysapproval);
grRitm.query();
if (grRitm.next()) {
approvals.push(grApprovals.getUniqueValue());
}
}
return approvals.join(',');
},
type: 'approvalTest'
});
here is the filter but it returns null , is there a way to run javascript via a filter,
here is the module setup:
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-20-2025 11:55 AM
Your script is incomplete, post the entire contents, include the Class. Your screenshot cuts off the value. Once you do that folks here can assist.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-20-2025 12:07 PM
thanks updated
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-20-2025 01:27 PM
Your script is not updated, nor is the screenshot showing how you are referencing the script include. I assume the script include contains no Class. but your script is missing a closing "}" after the return statement.
Without the requested detail, we are guessing at what is wrong.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-20-2025 02:49 PM
full code is there now