- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-20-2022 06:20 AM
i want to hide the certain locations of the Reference field to cnm_location table, Specific to one catalog item.
As the variable is in variable set using in multiple catalog items ,reference Qualifier will not work
how to achieve this by script?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-21-2022 05:41 AM
Hello Sudesh,
You can create a new variable in your variable set for example catalog_item_id and then use the onLoad client script on your variable set to set the catalog ID in this variable:
g_form.setValue("catalog_item_id", g_form.getParameter("sys_id"));
then in your reference qualifier you can pass the catalog Item ID
javascript:new your_script_include_name().function_name(current.variables.catalog_item_id);
and in your script include then you can apply query based on the catalog item id and return the result. So in future if you receive a similar requirement for other catalog Item you can just update the query or script in your script include to return the data accordingly.
If my answer helped you in any way then please do mark it as helpful. If it answered your question then please mark it correct and helpful.
Thanks

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-21-2022 12:02 AM
Hello,
You can simply hide this field on your catalog item and create a new field and apply reference qualifier. You can even do with existing variable set but it requires coding which is not required.
Please hit like and mark my response as correct if that helps
Regards
Regards,
Musab
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-21-2022 05:41 AM
Hello Sudesh,
You can create a new variable in your variable set for example catalog_item_id and then use the onLoad client script on your variable set to set the catalog ID in this variable:
g_form.setValue("catalog_item_id", g_form.getParameter("sys_id"));
then in your reference qualifier you can pass the catalog Item ID
javascript:new your_script_include_name().function_name(current.variables.catalog_item_id);
and in your script include then you can apply query based on the catalog item id and return the result. So in future if you receive a similar requirement for other catalog Item you can just update the query or script in your script include to return the data accordingly.
If my answer helped you in any way then please do mark it as helpful. If it answered your question then please mark it correct and helpful.
Thanks