How to conditionally display a choice list

Paul Coste
Kilo Explorer

How might one go about conditionally displaying (or NOT displaying) a choice list on a field of type String, and then dynamically populating the choice list?

Scenario:

I have a field called "Value" that is defined as type String.  When I am creating or updating the record, I want the Value field either to display as a Choice list (with dynamic choices specified by a Choice Script) OR to display as a standard Text field.  I know how to do the Choice Script on a field to show dynamic choices, but I am not sure if there is a way to override the functionality.  Ideally I would like to do this in a Client Script, rather than modify the Dictionary Entry for that field.

3 REPLIES 3

Weird
Mega Sage

Is there a reason for wanting to use one specific field for this?
Sounds like you would have a lot less work with two fields. One that is a choice list and one that is a regular string field. You'd then only need to use UI Policies to handle the visibility.

nitish
Kilo Expert

Hi,

Agree with Joni's reply that you should create two separate fields with string and choice type. As per business logic show /hide those fields.

Regards

Paul Coste
Kilo Explorer

Agree with both replies -- this would be the most straightforward way to achieve that functionality.  The reason for my question as stated is that I am looking to do this on an out of box component and I am looking to minimize my customization footprint, ideally not having to modify the table or dictionary entries at all.  I was hoping that I could do this entirely from a UI script on an existing text field.  From what I can find there does not seem to be a way to do this, so yes I will most likely either create a custom field or rethink my approach entirely.