Welcome to Community Week 2025! Join us to learn, connect, and be recognized as we celebrate the spirit of Community and the power of AI. Get the details  

How do you get the sys_id of a catalog item in a catalog client script?

e_wilber
Tera Guru

I have a catalog client script on some of my forms where I need to know the sys_id of the catalog item itself (not the unique instance of the form record).

I have tried g_form.getParameter("sysparm_id") in an onload script and it's bringing back a sys_id that does NOT match the catalog item sys_id.

I have also used g_form.getUniqueValue() to no success. How do I get the catalog item sys_id back in my client script?

9 REPLIES 9

jdestef
Tera Contributor

g_form.getSysId();  // in London

 

 

miked_jones
Giga Expert

What happens when you call g_form.getUniqueValue()?

That seems to be the most reliable way to get the sys_id of your catalog item and works in both the UI and in ServicePortal. 

Are you accessing the item directly, or as part of an order guide?

I get the same thing as getSysId();

Kinda new to SN so I don't know what you mean by Order Guide -- In my use case, I just needed the sysid for use in a stand alone service catalog item.

 

g_form.getUniqueValue(); still works perfectly fine.

 

Version: Sandiego

JC gonzalez esp
Tera Contributor

Did you manage to solve?