Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

I need a script of unauthorized record deletion in business rule

deepakbisht
Kilo Contributor
 
1 ACCEPTED SOLUTION

Dushyant Siroh
Tera Expert

Hi @deepakbisht 

 

Please Use Before Delete 

 

use this script :-

 

if (!gs.hasRole('admin')) {
   gs.addErrorMessage('You are not authorized to delete this CI.');
   current.setAbortAction(true);
}

 Kind Regards,

Dushyant Sirohi

View solution in original post

1 REPLY 1

Dushyant Siroh
Tera Expert

Hi @deepakbisht 

 

Please Use Before Delete 

 

use this script :-

 

if (!gs.hasRole('admin')) {
   gs.addErrorMessage('You are not authorized to delete this CI.');
   current.setAbortAction(true);
}

 Kind Regards,

Dushyant Sirohi