script include filter not working on company table
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
53m ago
Hello team,
I am trying to filter out the company in company table which are used in "Business Application" table .
I have created script include which is in different scope than global scope and accessible from is "This application scope only"
Script :--
function GetCompany() {
var companies = [];
var ga = new GlideAggregate('cmdb_ci_business_app');
ga.addNotNullQuery('company');
ga.groupBy('company');
ga.query();
while (ga.next()) {
companies.push(ga.getValue('company').toString());
}
return companies.join(',');
}
.................................................................
And on company table filter is :--sysid is one of javascript:GetCompany()
when i run the filter it becomes sysid in NULL.
NOTE:-- I have checked sandbox enabled.
thank you
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
26m ago
1st issue is the accessibility.
Script include can't be called unless you make it Accessible from All scopes
Did you try updating that?
from where are you calling that? share screenshots
💡 If my response helped, please mark it as correct ✅ and close the thread 🔒— this helps future readers find the solution faster! 🙏
Ankur
✨ Certified Technical Architect || ✨ 10x ServiceNow MVP || ✨ ServiceNow Community Leader
