What does the "Choices unload" business rule really do?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-24-2015 09:24 AM
The choice table has turned out pretty big due to some categorization schemes and now every time I try to delete an option or even make any updates to a choice, it takes forever to do. I'm pretty sure it's because of the Choices unload and the Choices unload - before business rules that came with the system, but I'm not sure what these rules do and the gs.unloadChoices(field, column) method is undocumented as well. Trying to figure out if it's okay to disable these at least temporarily while I clean up the choice list tables, because these rules even run on delete.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-09-2017 11:59 AM
Hey Kim - from working with many quirks related to the sys_choice table it seems that for *form view* (not in list view) each node keeps a cache of choices to display. Often times we will have someone report they can't see certain impact or urgency values from node 007, but we can see them on node 010. Then if we login in and out enough to get on node 007, we also won't be able to see them.
Often, if we just change something trivial about the choices, it seems to synchronize them again through these business rules. But that being said I don't know exactly how they work.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-14-2017 04:25 PM
Hi Hiko,
The business rule is used to update the sys_update_xml file. Updates to sys_choice are tracked differently than other record types. For example, when you update a business rule, we write out that one record as a sys_update_xml file. Choice list update sets are handled differently as described here:
http://wiki.servicenow.com/index.php?title=System_Update_Sets#Choice_Lists&gsc.tab=0.
Disabling these rules would mean that your updates are not recorded properly in update sets.
In the case where you need to remove choices, from past experiences, the business rule can be deactivated, then you will be able to remove the inactive choices and enable the business rule again.
I hope this answers your question.
Jose
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-14-2017 04:45 PM
Its Important to note that choice lists are best served with small lists. If your category lists are long you may consider creating a custom category table and change the category to a reference field instead. Then you can remove the records from the choice table.