Choice value appears in blue from the list

LdR
Tera Expert


Hello,
I have a Choice field whose list depends on another field (Reference to another table).
I retrieve the list via a GlideAjax and a Script Include.

I made a double Client Script (one onChange and another onLoad).

It seems to work, but from the list I noticed that the value saved by the Choice field is in blue ↓

find_real_file.png

Why?

Thanks in advance.

5 REPLIES 5

Daniele Songini
Tera Guru

Hi,

the values appear in blue in the list if they are not defined in the options.

if for example you have a choice with options 1,2,3
and you enter the value 4 with a script, you will see it in blue
.

Check your options.

Try also to read this
I have a choice that is showing in blue.

Please mark this as "Correct Answer" if I have given you a sufficient answer to your question.

Best Regards,
Daniele

Natanael Osvald
Tera Expert

Let me point a issue that I've figured out some time ago!

If there is choices at some table field, you probably will faced this issue:

This could happen if you use getDisplayValue() to set values through BR or Workflow

This way you'll include at your table something like this:
//E.g. Category should have two choices Planned with Value 0 and Not Planned with Value 1
//Choice list should be:
1: Not Planned
0: Planned

If you do this through workflow:
//GET INFO
workflow.scratchpad.category = current.variables.u_category.getDisplayValue();
//Inserting '0' per exemplo, getDisplayValue() going to ge 'Planned' instead
gr.t_category = workflow.scratchpad.category;

//or BR
gr.t_category = current.variables.u_category.getDisplayValue();

The result going to be:
1: Not Planned
0: Planned
Planned: Planned //This one should be appear in blue!


Correct way:

workflow.scratchpad.category = current.variables.u_category.getValue();

Regards,

Wolf

Pratiksha Kalam
Kilo Sage

Hello,

Can you check for field style from where this choices are coming?

 

Thanks,

Pratiksha

 

Tim Provin
Mega Guru

You stated that you are retrieving the list via GlideAjax and a Script Include.  It sounds like the value(s) that you are returning are the "Label" from the sys_choice table.  Ideally you would want to return the "Value" from that script include, or potentially both if you need them.