How to reference sys_choice table ?

WA1
Kilo Sage

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! 

1 REPLY 1

Sai Kumar B
Mega Sage
Mega Sage

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.