Scoped app overwriting global choice list

ekelly
Kilo Contributor

We currently have two global choice lists that are being overwritten every time we update a scoped application. It looks like over time developers have added choice list items while in the application scope rather than global. They've gone back and removed the scope application choice list items and properly created them in global, but the scoped application is holding that choice list and overwriting it every time.  

 

I have gone through the application files and cannot find any references to these choice lists, but when I update the app in QA the log files show the updates to the global choice lists. Do I have any options here? When we discovered this last month, we just did an additional global update set that was implemented after the app to properly populate the choice lists, but that'll get forgotten at some point and really is a bit of a pain.

1 ACCEPTED SOLUTION

Pradeep Sharma
ServiceNow Employee
ServiceNow Employee

Hello Erin,



Can you please navigate through the application files(filter by your scoped app) and check for the class "Metadata snapshot". Make sure you don't have any entires in there.


View solution in original post

7 REPLIES 7

Aditya Telideva
ServiceNow Employee
ServiceNow Employee

it looks like you can update the sys_choice record via a background script.


1) Create the choice value with a 'name' value of a table in the application scope


2) note the sysid


3) create the background script and run


- I am not sure how this will go in an update set and pushed to another environment. should be itneresting to test



var gr = new GlideRecord('sys_choice');


if(gr.get('dca2e45d4f3c030059d6ab4f0310c75b'))


{


gr.name = 'name_of_table_you_actually_need';


gr.update()


}


Thanks,


Aditya Telidevara


Thanks, but I'm actually trying to take the choice list entry OUT of the scoped application as it's over writing global changes and I don't want to have to update our global choice list with every monthly release.


Pradeep Sharma
ServiceNow Employee
ServiceNow Employee

Hello Erin,



Can you please navigate through the application files(filter by your scoped app) and check for the class "Metadata snapshot". Make sure you don't have any entires in there.


Thank you so much. That is exactly the problem.