Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

'Updates are already being recorded for this table' error when I tried to add Schedule Job to update set

Sravani Boggara
ServiceNow Employee
ServiceNow Employee

Hi,

When I try to add schedule Job to update set using 'Force to Update Set' UI Action, I receive this error - Updates are already being recorded for this table

This started happening after the instance is moved to FUJI. In case you knows what is going on, please drop in a comment.

Thanks!

12 REPLIES 12

I just tested the script in demo instance which is on Fuji version. The scheduled job was captured in the update set.



//Commit any changes to the record  


current.update();  


 


 


//Check to make sure the table isn't synchronized already  


var tbl = current.getTableName();  


 


 


if(tbl.startsWith('wf_') || tbl.startsWith('sys_ui_')|| tbl == 'sys_choice' || current.getED().hasAttribute('update_synch')   || current.getED().hasAttribute('update_synch_custom'))


{  


    gs.addErrorMessage('Updates are already being recorded for this table.');  


    action.setRedirectURL(current);  


} else {  


    //Push the update into the current update set  


    var um = new GlideUpdateManager2();  


    um.saveRecord(current);  


       


    //Query for the current update set to display info message  


    var setID = gs.getPreference('sys_update_set');  


    var us = new GlideRecord('sys_update_set');  


    us.get(setID);  


       


    //Display info message and reload the form  


    gs.addInfoMessage('Record included in <a href="sys_update_set.do?sys_id='   + setID + '">' + us.name + '</a> update set.');  


       


    action.setRedirectURL(current);  


}  


sushant06251
ServiceNow Employee
ServiceNow Employee

Hi I faced the same issue.



To capture the Scheduled Job to an update set please execute following script (use background script or Xplore). Change sys_id with the id of the record you want to capture.



****************************************************************************************************************************************************


var current = new GlideRecord('sysauto_script');


current.get(sys_id);



if (typeof GlideUpdateManager2 != 'undefined')


      var um = new GlideUpdateManager2();


else


      var um = new UpdateManager2();


um.saveRecord(current);



//Query for the current update set to display info message


var setID = gs.getPreference('sys_update_set');


var us = new GlideRecord('sys_update_set');


us.get(setID);



//Display info message and reload the form


gs.print('Record included in <a href="sys_update_set.do?sys_id=' + setID + '">' + us.name + '</a> update set.');


****************************************************************************************************************************************************



Hit Like if you find it useful.


It's not working for scoped application do you have any alernative?

GlideUpdateManager2 is not allowed in scoped application