How to replace GlideScriptRecordUtil in Scoped applications ?

Siva Prasad Up1
Tera Contributor

We are developing a custom scoped application for PPM .

Requirement is to update a record feed of a project , when a new status update(using Status Updates -Related list ) record is created.

I have created the Table notification for the same and it is throwing me the following error when a new status update is created.

GlideScriptRecordUtil is not allowed in scoped applications

I did check and came to know business rule created by Table notification is causing this , Business rule script contains

function onBefore(current, previous) {

    //This function will be automatically called when this rule is processed.

var gru =   new GlideScriptRecordUtil.get(current)

var fieldsChanged = gru.getChangedFieldNames();

gs.eventQueue('live_feed.update', current, fieldsChanged.toString(), current.sys_mod_count);

 

}

Is there any replacement for this GlideScriptRecordUtil class in Scoped apps?

12 REPLIES 12

Thanks for sharing


iverduzco
Tera Expert

I got this working by creating a global script include, available to all scopes, formatted like this:

/**
 * provides the global GlideScriptRecordUtil utility to scoped applications
 * @namespace
 */
var ScopedGlideScriptRecordUtil = {};
(function(){	
	ScopedGlideScriptRecordUtil.get = function(gr) {
		return GlideScriptRecordUtil.get(gr);
	};	
})();

Akash Gandani
ServiceNow Employee
ServiceNow Employee

Hello.. I am new in this.. and found this page after I discovered the error 'GlideScriptRecordUtil is not allowed in scoped applications'.. I cloned a widget under a scoped app and the widget contains 'GlideScriptRecordUtil' to update the details of a record.. Am still not sure about the workaround for this. Can someone please help? Thanks