How to reference sys_choice table ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-17-2022 01:44 AM
Hello,
I wanted to create a field that references the table "sys_choice" but it wasn't possible I got an error telling that we can't reference "sys_choice" table and that we should use another table.
How can I get records from "sys_choice" table based on a condition and then use them as a list of values in another field ?
Should I create a field of type choice and then do a fix script to populate data or should I duplicate records in a new table ?
Thank you in advance!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-17-2022 02:45 AM
Hi,
This is controlled by a business rule (Prevent Reference to Choice [sys_choice]) and a UI Policy (SysChoice reference prevention). Disabling those will allow the reference to be created. However, this is probably not recommended.
An alternative approach could be fetching choices using the GlideElementAPI getChoices method.