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

fschuster
ServiceNow Employee
ServiceNow Employee

Hi Siva,



GlideScriptRecordUtil is indeed a core java class and not on the list of Scoped Scriptable Objects and therefore not accessible from a scoped app (even with global.xyz). I will verify for you if there are any plans to make it available any time near soon.



I'm aware that the following suggestion is by far not ideal, but in the meantime you could write your own little function that verifies if certain fields did change via the GlideElement API and the changes() function (e.g. pass on an array of fields that you want to check and let your function return the field name if a change happened).


Any update on this?   Also very interested in using GlideScriptRecordUtil in a scoped app.   Thanks!


Sorry gents, have been on vacation. Haven't heard anything specific in terms of a potential date, but we are aware that it would surely be beneficial to have access to that API. I'll let you know if I should get anything more specific.


any update on this ?