- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-09-2022 04:50 PM
I am a newbie in scripting. I have the following onChange script in a catalog item. I need that when company field change then s_u_program and s_u_lob content is clear so that the content of those fields is clear (no values). The script below is not working or is not executed or the values are not clear. Therefore, your expert advise to help me correct this issue will be appreciated.
function onChange(control, oldValue, newValue, isLoading) {
if (isLoading || newValue == '') {
return;
}
//Type appropriate comment here, and begin script below
g_form.clearValue('s_u_program');
g_form.clearValue('s_u_lob');
g_form.addErrorMessage('Onchange Script');
}
Fig. 1
Solved! Go to Solution.
- Labels:
-
Scripting and Coding
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-09-2022 05:11 PM
Hi
If you are testing through Service Portal, Then you need to change the UI Type to All.
Please check and let us know.
Thanks 🙂
Shakeel Shaik 🙂

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-09-2022 04:55 PM
Can you set UI type to All and try below script
function onChange(control, oldValue, newValue, isLoading) {
if (isLoading || newValue == '') {
return;
}
//Type appropriate comment here, and begin script below
g_form.setValue('s_u_program','');
g_form.setValue('s_u_lob','');
alert('Onchange Script');
}
Please mark this response as correct or helpful if it assisted you with your question.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-09-2022 05:11 PM