- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-15-2019 12:18 AM
Hello All,
I am creating dependent Variables on catalog item via client script.
Server certificate variable will be dependent on Location Variable.
Now the catalog where I am defining it is contains ordered guide, Location filed is set on one page and the dependent field is set on another page.
I have written below on change client script to achieve this but not working:-
function onChange(control, oldValue, newValue, isLoading) {
if (isLoading || newValue == '') {
return;
}
if(newValue=="TM-01"){
g_form.removeOption('ServerCertificate1', "rsp-1000.oberthur.net");
g_form.removeOption('ServerCertificate2', "rsp-1000.oberthur.net");
g_form.removeOption('ServerCertificate3', "rsp-1000.oberthur.net");
}
}
Solved! Go to Solution.
- Labels:
-
Scripting and Coding
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-15-2019 10:17 PM
Hello Harshvardhan,
Thank you for the help.
I solved this issue, by making my script onLoad not on change.
I just had a thought that my catalog is using order guide, and that location variable is not on the same page where i want to remove the option.
so on change script is defiantly not gonna work.
Here is the catalog client script for future reference, from which I achieved the desired result:-
function onLoad() {
if(g_form.getValue('Location') == "TM-01"){
g_form.removeOption("ServerCertificate1", "rsp-0000.oberthur.net");
g_form.removeOption("ServerCertificate2", "rsp-0000.oberthur.net");
g_form.removeOption("ServerCertificate3", "rsp-0000.oberthur.net");
}
}
Regards,
Priyanka
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-15-2019 12:40 AM
HI
Below link may help you
Please make this answer is correct if answer your question
Thanks
Chandu
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-15-2019 12:53 AM
Hi Priyanka,
You may make a variable on another variable either based on Catalog Client Script (for Select Box type variables) or via Reference Qualifier (for Reference/List collector type variable). Please refer the below helpful links to achieve the same.
1. https://old.wiki/index.php/Adding_Dependent_Variables
2. https://old.wiki/index.php/Adding_Dependent_Reference_Variables
Hope this helps. Please mark the answer Correct/Helpful based on the impact.
Regards,
Amlan
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-15-2019 03:29 AM
Hello Amlanpal and Chandu Telu,
thank you for all of your reply.
I am not asking how to build this, I already picked up the solution which I can apply in current environment.
I have gone thrue with all the link, then only i have created the above script.
if you can let me know, what is wrong with the catalog client script which i have written.
Regards,
Priyanka

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-15-2019 03:50 AM
i would suggest here to add some alert in your catalog client script to validate the value of newValue . kindly share the alert details. make sure the condition is working or not
example:
function onChange(control, oldValue, newValue, isLoading) {
if (isLoading || newValue == '') {
return;
}
alert('New Value'+ newValue);
if(newValue=="TM-01"){
alert('if condition is working');
g_form.removeOption('ServerCertificate1', "rsp-1000.oberthur.net");
g_form.removeOption('ServerCertificate2', "rsp-1000.oberthur.net");
g_form.removeOption('ServerCertificate3', "rsp-1000.oberthur.net");
}
}