remove option from a list collector on a record producer

MWALR
Kilo Contributor

Hi,

I have a requirement on a record producer to remove certain options when another variable choice is selected above. e.g. if subcategory is "lease", then remove option "other" in the list collector.

I have tried a catalog client script but i can't get it to work. This is onChange of the subcategory variable:

function onChange(control, oldValue, newValue, isLoading) {
if (isLoading || newValue == '') {
return;
}

if (newValue== 'Lease') {

g_form.removeOption('u_type', 'Other');

}

Can anyone help?

Many thanks

M

5 REPLIES 5

shivanshu272
Tera Contributor

To remove certain options when another variable choice is selected in Record Producer, follow these steps:

1. Go to Subcategory variable, and under Type Specification tab use "Reference qual" field

2. Write query:

 

 javascript: new script_include_name().method_name(current.variables.subcategory + "");​

3. Create script include and method to be called from Reference qual, and check if subcategory is "lease" then return query that will remove "other" from list collector. (If you are facing difficulty in writing query, I can help you there)

 

4. Click on Save button to save the changes on variable and script include.

 

Attaching example of reference qual.

Screenshot 2024-10-15 172849.png

 

Thanks,

Shivanshu