Function setForceUpdate is not allowed in scope
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-11-2016 12:28 PM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-13-2016 01:26 AM
Hello,
You can try server side scripting (script include) to run the functions not available in scope application and then call them from client side.
For example, create a Script Include (Client Callable) like below:
var testSetForceUpdate = Class.create();
testSetForceUpdate.prototype = Object.extendsObject(AbstractAjaxProcessor, {
testSetForceUpdate: function() {
var table = this.getParameter('sysparm_table');
var recordId = this.getParameter('sysparm_record_id');
var gr = new GlideRecord(table);
gr.addQuery('sys_id', recordId);
gr.query();
gr.next();
gr.setForceUpdate(true);
gr.update();
},
type: 'testSetForceUpdate'
});
Now, if you want to call the setForceUpdate function from a client script, you can create a client script like below:
function onLoad() {
var ga = new GlideAjax('testSetForceUpdate');
ga.addParam('sysparm_name', 'testSetForceUpdate');
ga.addParam('sysparm_table', 'incident');
ga.addParam('sysparm_record_id', g_form.getUniqueValue());
ga.getXML();
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-09-2019 11:21 AM
setForceUpdate does not work in other scopes but an alternative way to fix that would be to run the script in Global scope but ensure you add an entry into Cross Scope Privileges Table
An example is shown below where you can add it for the script to be executed in Global scope but the records are in Vulnerability Response scope.