- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-17-2014 12:33 PM
So I have this code in a UI action and it was working to push data from a category relationship table to an update set but it is frequently not working. It seems odd as to when it will work and when it does not, there seems to be no reason.
If you can look at the code and see if there are any problematic areas that would be great. Let me know if you need any more information.
//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 Packages.com.glide.update.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.addInfoMessage('Record included in <a href="sys_update_set.do?sys_id=' + setID + '">' + us.name + '</a> update set.');
action.setRedirectURL(current);
}
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-17-2014 01:20 PM
I don't know if this is the problem, but since Calgary the Packages call has been replaced with the call: GlideUpdateManager2
See https://wiki.servicenow.com/index.php?title=Packages_Call_Replacement_Script_Objects
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-17-2014 01:20 PM
I don't know if this is the problem, but since Calgary the Packages call has been replaced with the call: GlideUpdateManager2
See https://wiki.servicenow.com/index.php?title=Packages_Call_Replacement_Script_Objects

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-17-2014 01:53 PM
I think your code comes from here: http://www.servicenowguru.com/system-definition/manual-update-set-inclusion/ Take a look, read the comments and maybe you can find something that have changed(package call replacement) since the last SN update and when you got it last. Good Luck!