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.

how to force new Hardware product model records into the global domain.

anerivirani19
Tera Contributor

I have a business rule created for this.

Before Insert

Order - 10000

Condition - Class is hardware model

Script -

 

(function executeRule(current, previous /*null when async*/) {

setGlobalDomain();

function setGlobalDomain() {
//make current transaction uncancelable while this rule runs,
//set variable to previous cancelable state to restore when done
var isCancelable = gs.setCannotCancel(true);
 
current.sys_domain = 'global';

//restore previous cancelable state
gs.setCannotCancel(isCancelable);
}
})(current, previous);
 
However this doesn't seem to work. It still creates the  new hardware product model under the user domain.
1 REPLY 1

Abbas_5
Tera Sage
Tera Sage

Hello @anerivirani19,

For a similar kind of issue, please refer to the link below:
https://www.servicenow.com/community/itsm-forum/how-to-force-new-manufacturer-records-into-the-globa...

 

If it is helpful, please mark it as helpful and accept the correct solution. In the future, it might be helpful for someone to refer to this solution.

Thanks & Regards,

Abbas Shaik