- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-11-2017 10:00 AM
Hey all,
Is it possible to have a conditional field based on a list collector on a catalog item? I can't seem to get mine working, starting to wonder if its the way a list collector works
I need a multi line text field to show if the list collector includes "Additional hardware, not listed"
Any thoughts?
Justin
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-11-2017 11:25 AM
Hi Steve,
Please write an onChange Catalog Client Script for the item with the change of that List Collector type variable. The script should be as of below. I also have answered similar one, which you can refer: setMandatory if ListCollector contains specific value
function onChange(control, oldValue, newValue, isLoading) {
if (newValue == '') {
g_form.setMandatory('variable_name', false); //Put the multi line type variable name which is needed to be mandatory
g_form.setDisplay('variable_name', false); //Put the same multi line type variable name which is needed to be visible at the same time
return;
}
if (isLoading || newValue != ''){
if (newValue.toString().indexOf("sys_id") >-1) { //Pass the sys_id of record 'Additional hardware, not listed'. You can get the sys_id of the record from the referred table
g_form.setMandatory('variable_name', true);
g_form.setDisplay('variable_name', true);
}
else
{
g_form.setMandatory('variable_name', false);
g_form.setDisplay('variable_name', false);
}
}
}
I hope this helps.Please mark correct/helpful based on impact
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-16-2024 10:45 PM
Worked a treat for me ! Thanks for the help.