- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-06-2023 05:04 AM
Hi All,
I need assistance in calling script include in the ACL.
Script Include:
var Test1 = Class.create();
Test1.prototype = {
initialize: function() {},
TestFunction: function(gr) {
var appgr;
var grd = new GlideRecord('sysapproval_approver');
grd.addQuery('document_id', current.sys_id); //Fetching for approval record
grd.query();
while (grd.next()) {
appgr = grd.group.assignment_group;
if (gs.getUser().isMemberOf(appgr)) //checking if loggedin user is member of approval gr
{
answer = true;
}
}
if ((gs.getUser().isMemberOf(current.assignment_group.toString())) || (gs.getUser().hasRole('u_confidential')) || (current.opened_by == gs.getUserID())) {
return true;
}
else
{
return false;
}
},
type: 'Test1'
};
ACL:
Problem.description (Field level acl-read)
How to call the script include in ACL. Kindly guide.
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-06-2023 05:08 AM - edited ‎03-06-2023 05:10 AM
Hi @Renu9
You can call the script include in a ACL using this syntax:
answer = new ScriptIncludeName().function();
Or if your script include is having just one main function, then simply calling it as:
answer = new ScriptIncludeName();
will also do the job.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-06-2023 05:08 AM - edited ‎03-06-2023 05:10 AM
Hi @Renu9
You can call the script include in a ACL using this syntax:
answer = new ScriptIncludeName().function();
Or if your script include is having just one main function, then simply calling it as:
answer = new ScriptIncludeName();
will also do the job.