- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-20-2020 03:05 AM
Hi All,
I have a variable set that is being used in many catalog items. One of the variable values in the set has to change based on the catalog item. For that I need to find out which catalog item is opened?
I tried using g_form.getUniqueValue() which is giving me sys id of the catalog item but it's not working in Order guide.
Any help on this? It should work for individual items as well as order guides. I do not want to have redundant code.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-20-2020 03:15 AM
Hi,
please check below links:
https://hi.service-now.com/kb_view.do?sysparm_article=KB0689536
can you try this: ensure isolate script is set to false
var catItemSysId = $("sysparm_id").value;
Mark ✅ Correct if this solves your issue and also mark 👍 Helpful if you find my response worthy based on the impact.
Thanks
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-20-2020 03:15 AM
Hi,
please check below links:
https://hi.service-now.com/kb_view.do?sysparm_article=KB0689536
can you try this: ensure isolate script is set to false
var catItemSysId = $("sysparm_id").value;
Mark ✅ Correct if this solves your issue and also mark 👍 Helpful if you find my response worthy based on the impact.
Thanks
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-20-2020 03:32 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-20-2020 03:36 AM
Hi,
Try this:
g_form.getParameter("sysparm_id") perfectly works with onload client script
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-20-2020 03:42 AM
Hi Vishakha,
Script itself is not executing. You see I have added an alert statement to check if it is executing or not. It is not executing because I did not select catalog item in the script.
I do not want to create 100 client scripts if I have this variable set in 100 catalog items