Call a script include to apply a reference qualifier on a catalog item variable: - variable reference qualifier dependent on another variable selection, in this case a variable referencing sys_user (requested_for) On the catalog item form. variable name to apply ref qual filter : retail_equipment variable reference qualifier (on cmdb table ): javascript : new refqual_functions (). lostStolen_getAssignedCIs (); client-callable script include ( refqual_functions) function : lostStolen_getAssignedCIs : function (){ //--called from variable set client script, for lost/stolen request (service catalog) gs . log ( current . variables . requested_for , 'retail_lostStolen_getAssignedCIs' ); return ( 'install_statusNOT IN8,7^owned_by=' + current . variables . requested_for ); //owned_by=1269b79937f1060041c5616043990e41^install_statusNOT IN8,7 },
String.prototype.replaceAll() was apparently added to JavaScript in ES2021, so it wouldn’t have been supported at all in ServiceNow prior to the Tokyo release. I do see it on the list of supported language features in the docs, but you would need to be in a scoped app (Tokyo or later) where you’ve explicitly enabled the ES2021 features.
ReplyDelete