Catalog Client Script does not execute from Service Portal

Ilamaaran
Kilo Contributor

I recently built a catalog item form to populate a value in a text field based on previous field values (multiple fields involved). when I preview the catalog item form by clicking the Try It button, the scripting works properly and I can see the desired results. However, when I am trying to view the form from Service Portal, the script doesn't run and the values are not populated. I don't understand what causes this issue. 

Has anyone gone through same issue? Please advice how to get this working? 

Here are the screenshots of the forms from Preview and Service Portal view

Preview from Catalog Item Try It button

find_real_file.png

 

Service Portal View

 

find_real_file.png

 

This is the script I have written to populate the values

 

function onChange(control, oldValue, newValue, isLoading)

{

if (isLoading || newValue == '')

{

return;

}


var tier;

tier = g_form.getValue('ConcatenateFields');

if (tier=='HighHighHigh')


{

g_form.setValue('TierClassification',"Tier 1");

}

else


{

g_form.setValue('TierClassification',"Invalid");

}


}

 

Note - the "concatenatefields" is another hidden field where I have concatenated all the three values selected in the selectedbox.

1 ACCEPTED SOLUTION

You have to make ui type to All to make that script working in all places. Make this change and your script will be working THANKS, SATHEESH

View solution in original post

5 REPLIES 5

SatheeshKumar
Kilo Sage
Did you modified ui type to All?? Thanks Satheesh

no. I have set the UI type to Desktop

Satheesh is correct,

You need to change the UI Type to "All" so it runs on both Desktop and Mobile / Service Portal. Change it the UI Type to "All" and you should be good to go.

Brent

P.S. If my suggestion helped then please mark as helpful and/or correct so other community members can benefit from this information.

You have to make ui type to All to make that script working in all places. Make this change and your script will be working THANKS, SATHEESH