- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-01-2015 03:29 PM
I see a bunch of screenshots on the community forms where admins have an Add To Update Set button on configuration records, is this part of a plugin or a custom add?
Solved! Go to Solution.
- Labels:
-
User Interface (UI)
- 9,195 Views
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-02-2015 07:16 AM
The "Add To Update Set" button is a Global UI action.
also, "Show Insert" and "Show update" are marked true.
the condition for this button is gs.hasRole("admin")
here is the script that is run.
//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
if (typeof GlideUpdateManager2 != 'undefined')
var um = new GlideUpdateManager2();
else
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);
}
you will also get an "Add To Update Set" button to your "Add To Update Set" button
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-01-2015 03:42 PM
Share and SNGuru have a few versions of this.
https://share.servicenow.com/app.do#/detailV2/18c99b618790b5002e7fb92489434d50/overview
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-02-2015 07:16 AM
The "Add To Update Set" button is a Global UI action.
also, "Show Insert" and "Show update" are marked true.
the condition for this button is gs.hasRole("admin")
here is the script that is run.
//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
if (typeof GlideUpdateManager2 != 'undefined')
var um = new GlideUpdateManager2();
else
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);
}
you will also get an "Add To Update Set" button to your "Add To Update Set" button
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-26-2017 09:54 AM
Has anyone added this option to the "Actions on selected rows" drop down menu? If so, how should script be written?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-26-2017 09:57 AM
If you download the version from Share that I posted above, it shows up as a Related Link on an individual record and also shows up as a list action in the drop down at the bottom of the list.