Dependent Values lookup

George56
Tera Contributor

Hello,  Was wondering if some one could help me with retrieving a list of sub-categories based on their dependent value.  Basically I have a catalog item where you pick a category and I want the sub-category list to only show those associated with the category.

Thanks

1 ACCEPTED SOLUTION

Mahesh23
Mega Sage

Hi,

 

You can try below method

For category 

 

Variable type : lookup select box 

Lockup from table : choice (sys_choice)

Lookup value field : value

lookup label field : label

reference qualifier: element=category 

if table specific 

reference qualifier = name=incident^element=category

 

For subcategory  

 

Variable type : lookup select box 

Lockup from table : choice (sys_choice)

Lookup value field : value

Lookup label field: label

reference qualifier: javascipt:'element=subcategory^dependant_value='+current.variables.'CATALOG ITEM CATEGORY VARIABLE NAME'

 

if table specific 

reference qualifier = javascript:'name=incident^element=subcategory^+current.variables.'CATALOG ITEM CATEGORY VARIABLE NAME'

 

variable attributes: ref_qual_elements=CATALOG ITEM CATEGORY VARIABLE NAME

 

Regards,

Mahesh

 

 

 

 

View solution in original post

11 REPLIES 11

George56
Tera Contributor

Both values are being pulled from our Software Product table.  I have both defined in my catalog item as Lookup Select Boxes.  For Category the Lookup from table is Software Product and the Lookup value field is Category.  For Sub Category the Lookup from table is also Software Product and the Look up value field is Sub Category.  I added the provided Reference Qualifier and Variable Attributes to the Sub Category variable and it returns all Sub Categories.

Use :

javascript: 'category='+current.variables.v_category

Assuming category is backend name in software product.


Raghav
MVP 2023

Mahesh23
Mega Sage

Hi,

You can try something like mentioned in the attachment images

 

Regards,

Mahesh

 

 

Mahesh23
Mega Sage

Hi,

You can try something like mentioned in the attachment images.

Regards,

Mahesh

 

Mahesh23
Mega Sage

Hi,

 

You can try below method

For category 

 

Variable type : lookup select box 

Lockup from table : choice (sys_choice)

Lookup value field : value

lookup label field : label

reference qualifier: element=category 

if table specific 

reference qualifier = name=incident^element=category

 

For subcategory  

 

Variable type : lookup select box 

Lockup from table : choice (sys_choice)

Lookup value field : value

Lookup label field: label

reference qualifier: javascipt:'element=subcategory^dependant_value='+current.variables.'CATALOG ITEM CATEGORY VARIABLE NAME'

 

if table specific 

reference qualifier = javascript:'name=incident^element=subcategory^+current.variables.'CATALOG ITEM CATEGORY VARIABLE NAME'

 

variable attributes: ref_qual_elements=CATALOG ITEM CATEGORY VARIABLE NAME

 

Regards,

Mahesh