- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-02-2018 07:26 AM
Hi All,
I have written a script include that needs to be called in BR. The script include will pick up the current user role and return true it role is 'Priority_override' or will return false.
How can we call this in a BR , I need to run another action in the BR if that Script include returns false.
Can you give some inputs please
Regards,
VASS
var prioritycheck = Class.create();
prioritycheck.prototype = {
initialize: function() {
},
priorityoverride: function() {
var rol = new GlideRecord('sys_user_role');
rol.addQuery('name', 'priority_override');
rol.query();
if (rol.next()) {
var hasRole = new GlideRecord('sys_user_has_role');
gs.addInfoMessage('no of rows..'+rol.getRowCount());
hasRole.addQuery('user', gs.getUserID());
gs.getUserID();
hasRole.addQuery('role', rol.sys_id);
hasRole.query();
if (hasRole.next()) {
return true;
}
else {
return false;
}
}
},
type: 'prioritycheck'
};
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-02-2018 07:30 AM
var priorityCheck = new prioritycheck();
var override = priorityCheck.priorityoverride();
if(override){
// do stuff;
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-02-2018 09:47 AM
Thanks for the Correction Abhinay
Regards
VASS
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-02-2018 09:41 AM
David
Thank you very much it worked as expected
Regards,
Srinivas.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-02-2018 09:44 AM
LOL.. I am not David!!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-02-2018 07:32 AM
var test = new ScriptIncludeName();
test.myMethod();
Thanks,
Anup