The UI Action "Track in Update Sets" adds an ugly table to my scoped app

Shawn Dowler
Tera Guru

I created a table in a scoped app, then much later decided it should track records in that table in update sets, so I used the UI action "Track in Update Sets" on the table. It appears to have created a table prepended with rep$ followed by the name of my original table. So instead of starting with x_ it starts with rep$x_ . Why did it do that and do I need to keep it cluttering up my application? It won't let me delete it. The table only shows a UI action for Delete All Records, but not Delete. I don't want this table created in my other instances.

When I go to the Custom Application form and try to delete the application file using the related list, I get an error info message: Insufficient rights to delete table rep$x_ditci_store_proc_event. User does not have delete access.

So now what? Am I stuck with this forever? It almost looks like this table was created temporarily while my table was being "parented."

1 ACCEPTED SOLUTION

Pradeep Sharma
ServiceNow Employee
ServiceNow Employee

Hello Shawn,



This is a temp table which will be cleaned up after a week. This is a known issue and the table should not be created in the scope. The workaround is to run a background script and change the application scope to global.



I hope this answers your question.


View solution in original post

3 REPLIES 3

Pradeep Sharma
ServiceNow Employee
ServiceNow Employee

Hello Shawn,



This is a temp table which will be cleaned up after a week. This is a known issue and the table should not be created in the scope. The workaround is to run a background script and change the application scope to global.



I hope this answers your question.


That's what I thought. Thanks!


Here is the background script I ran that moved the table out of my application:



var grTable = new GlideRecord('sys_db_object');


grTable.get('8efd12900f904300abfedb0be1050ef7');


grTable.sys_scope = 'global';


grTable.update();



I also ran a script to move the columns out of the scoped app to Global. Replace the tableName variable assignment with the name of your table.



var tableName = 'rep$x_your_table_name';


var grField = new GlideRecord('sys_dictionary');


grField.addQuery('name', tableName);


grField.query();



while (grField.next()) {


  grField.sys_scope = 'global';


  grField.update();


}



It is interesting to note that the sys_id of the global scope is not a hex number with 32 digits, but it the word global. I thought I was not copying the sys_id properly until I went back and checked the sys_id listed in the Global scope's URL.