how to display choice label instead of choice value in RITM ?

Senthil14
Kilo Explorer

We have a onchange catalog client script, which also applies to a requested item. This script is used to generate the possible choices for the user,e.g.: This works when one field value is changed

 

g_form.addOption('u_tcc', '1', 'A1 - NO FINANCING');   where u_tcc = variable, '1' = choiceValue, 'A1 - NO FINANCING' = choiceLabel.

g_form.addOption('u_tcc', '2', 'A2 - REPAY');

g_form.addOption('u_tcc', '3', 'A3 - FIN');

g_form.addOption('u_tcc', '4', 'A4 - VALUE DISC');

 

This works and the values are showing fine on the catalog form (meaning choice Label), however on subsequent requested item form, the selection is displayed based on the choice Value attribute (1,2,3,4), instead of the choice Label attribute. Also, when we are exporting the choices etc., the choice Value is shown instead of choice Label.

 

Is there a way to go around this? One idea would be to have the same entries for choice Label and choice Value, but we would prefer no to go this way...

 

Many thanks!

3 REPLIES 3

Ahmmed Ali
Mega Sage

best option is to have those entries in sys_choice table for RITM. but as yuo don't want that, Here are my thoughts:

1. As you told the catalog client script applies to both catalog view and requested item, then make the script to work onload also. i.e remove "isLoading" from the client script. but this will work only for requested Item. but while exporting it will again take values only instead of label as these labels are not stored.

2. you can make value same as label. so it appear same in both catalog view, RITM and also while exporting it will take value which is in turn actual label. i.e use below statement

g_form.addOption('u_tcc', 'A1 - NO FINANCING', 'A1 - NO FINANCING');

but check in the scripts if you have hardcoded these values there.

 

Thanks,

Ali

If I could help you with your Query then, please hit the Thumb Icon and mark my answer as Correct!!

Thank you,
Ali

Hi Ali,

Thank you for this post, I had the same issue as Senthil and removing 'isLoading' from the onChange client script has now allowed me to see the labels instead of values in both the RITM and SCTASK 🙂

Rich

Sai Kumar B
Mega Sage
Mega Sage

Hi, 

This happens because you're adding choices via script, those were not added into database. First create those choices into the choice field. In script use g_form.clearOptions() to clear all the options and then use g_form.addOption() to add options again.

Please mark my answer as helpful/correct, if applicable.

Best regards,
Sai Kumar