Set all fields to None in catalog item
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-03-2023 06:05 PM
How to write a onchange catalog script to set all other fields to --None--, if none is selected in the select box variable (I have chosen include none)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-04-2023 04:39 AM
Based on state field , if I set to none , the bottom field should also be set to none
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-04-2023 07:00 AM
Hi @J_31
As per my screenshot, you can define a condition <your variable> is None. Then under related list UI Policy Action, you can add all variables and check the Clear the value checkbox.
You can also achieve it through a client script.
Sample below for a Client Script OnChange State/Market variable
function onChange(control, oldValue, newValue, isLoading, isTemplate) {
if (isLoading) {
return;
}
if (newValue === '') {
//replace your variable name
g_form.clearValue('select_role');
g_form.clearValue('do_you_need_to_set_up_as');
g_form.clearValue('home_address');
g_form.clearValue('care_manager_type');
}
}
Cheers,
Tai Vu