How can I add the "Add to Update Set Button" to my config pages?

josh_tessaro
Giga Expert

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?

Matt Saxton

1 ACCEPTED SOLUTION

Tyler Hoge - Gl
Tera Guru

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


6-2-2015 10-13-52 AM.png


View solution in original post

6 REPLIES 6

Michael -



Thank you for that.   I have a SNOW HI account, but am having difficulty trying to register for a SNOW Share account.   I have emailed the alias given to me.   Once I get this issue addressed I can try to download what you hosted on the Share site.



Thank you again,



Joe


Michael -



I am still having issues with trying to get a SHARE account.



Would you be able to provide me with the code for the list action drop portion of the "Add to Update Set" feature I am trying to enable?



Thank you,



Joe