The CreatorCon Call for Content is officially open! Get started here.

how to get setForceUpdate functionality in scopped app

corbettbrasing1
Mega Guru

How do I recreate this functionality in a scoped app? Not sure why it was removed but I need to trigger other business rules form a ui action without updating the record.

6 REPLIES 6

Barak Pinchovsk
ServiceNow Employee
ServiceNow Employee

Better yet, you can use GlideQuery, this way:

// GlideRecord's "gr.setForceUpdate(true)" can't be called from scoped apps.
// Use GlideQuery instead.
new global.GlideQuery(TABLE_NAME)
        .forceUpdate()
        .where(FIELD_NAME, VALUE)
        .update();

Confirmed.  This works.