How to pass Catalog Item sys_id in Reference qual?

harish_nalla
Kilo Contributor

Hi

 

I am trying to pass Catalog Item sys_id from Reference qual of a variable to Script Include.

But whenever i does current.sys_id, it is passing random value to the Script Include. Neither passing current alone has worked.

The syntax how i used Reference qual is as follows: javascript: new SIName().functionName(current.sys_id);

 

What should i do instead?

Thanks in advance.

Regards

6 REPLIES 6

Mike Patel
Tera Sage

try current.sc_cat_item.sys_id

Hi Mike

 

Tried this. Was getting undefined value.

Basically, when i did current.sys_id. That itself is populating some random sys_id, most possibly Cart sys_id.

 

Regards

Harish

ArunKRam
Giga Expert

Hi Harish, 

Are you using Service Portal to render the catalog item form? Any ways, You dont have to pass the sysid from the refernce qualifier. You can directly get the sysid of the current item in the script include.

 

Thanks,

Arun

Deepak Ingale1
Mega Sage

Hi,

 

You can create a variable lets say "v_cat_id" and populate its values using onLoad catalog client script

 

g_form.setValue("v_cat_id", g_form.getParameter("sys_id"));

 

Once done, use this variable for reference qualifer.

 

new SIName().functionName(current.variables.v_cat_id);