How to get current catalog item into reference qualifier ?

Yugi
Tera Expert

Hi all,

Is there a way to get a current catalog item into reference qualifier of variable ? I tried current.sys_id, current.sc_cat_item.sys_id, g_form.getParameter("sys_id") but got no luck.

1 ACCEPTED SOLUTION

Alberto Consonn
ServiceNow Employee
ServiceNow Employee

Hi,

You have to create a variable like "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);

Hope this will fit your need!

If I have answered your question, please mark my response as correct so that others with the same question in the future can find it quickly and that it gets removed from the Unanswered list.

Thank you

Cheers
Alberto

View solution in original post

8 REPLIES 8

dvp
Mega Sage
Mega Sage

can you try 

current.cat_item

dvp is spot on.

Great help! worked exactly as needed

Barb5
Mega Contributor

looking for a simple but dynamic reference qualifier on a variable set used to cascade variables into order guide component catalog items, 

attribute:

ref_qual_elements=u_catalog_item,is_searchable_choice

where u_catalog_item is a field being used to filter the table return of a Lookup Select box, 2nd attribute is to make Lookup Select Box searchable

reference qualifier:

javascript:'u_active=true^u_catalog_itemCONTAINS' + current.cat_item;