How to call script include in BR?

vass2
Mega Expert

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

find_real_file.png

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'
};

 

1 ACCEPTED SOLUTION

Dubz
Mega Sage

var priorityCheck = new prioritycheck();

var override = priorityCheck.priorityoverride();

if(override){

// do stuff;

}

View solution in original post

8 REPLIES 8

Thanks for the Correction Abhinay

 

Regards

VASS

David

Thank you very much it worked as expected

 

Regards,

Srinivas.

LOL.. I am not David!!

anupraheja
Tera Expert

var test = new ScriptIncludeName();

test.myMethod();

 

Thanks,
Anup