We've updated the ServiceNow Community Code of Conduct, adding guidelines around AI usage, professionalism, and content violations. Read more

can we call script include from business rule?

snajaykumar1234
Kilo Expert

if its yes, give me a example...

thanks

sanjay

10 REPLIES 10

cloudops
Tera Expert


var ApprovalEntitlementUtil = Class.create();
ApprovalEntitlementUtil.prototype = {
initialize: function () { },

//on create approval, return the entitlement status returned by licensing API here
onCreateApproval: function (usersysid, tablename) {
try {
var isEntitled = new sn_lef.GlideLicenseAPI().canUserApproveOnTable(usersysid, tablename);
return isEntitled;
}
catch (e) {
gs.log("Error with onCreateApproval: GlideLicenseAPI failure.");
}
},

//on adjudicate approval, return the entitlement status returned by licensing API here
onAdjudicateApproval: function (usersysid, tablename) {
try {
var isEntitled = new sn_lef.GlideLicenseAPI().enableEntitlementLogging().canUserApproveOnTable(usersysid, tablename);
return isEntitled;
}
catch (e) {
gs.log("Error with onAdjudicateApproval: GlideLicenseAPI failure.");
}
},
type: 'ApprovalEntitlementUtil'
};

 

For asking ServiceNow-related questions try this :
For a better and more optimistic result, please visit this website. It uses a Chat Generative Pre-Trained Transformer ( GPT ) technology for solving ServiceNow-related issues.
Link - nowgpt.ai