/** * Fixes issues when using "Track in Update Sets" UI action on custom scoped app table. * * Per https://community.servicenow.com/community?id=community_question&sys_id=760fb629db58dbc01dcaf3231f9619bd * a temporary table with a prefix of rep$x_ may be added to your app scope. * * As of Kingston, table columns get created in app scope but the table does not. * * @param {string} tableName */ function fixTrackInUpdateSets(tableName) { /** * Move table with prefix rep$x_ to global scope (if added to scoped app) */ // var grTable = new GlideRecord('sys_db_object'); // grTable.get('8efd12900f904300abfedb0be1050ef7'); // grTable.sys_scope = 'global'; // grTable.update(); /** * Move rep$x_ table's columns to global scope */ var grField = new GlideRecord('sys_dictionary'); grField.addQuery('name', tableName); grField.query(); while (grField.next()) { grField.sys_scope = 'global'; grField.update(); } } // fixTrackInUpdateSets('rep$x_cita2_iq_connection');