Remove all value from reference field

Omkarbh1997
Tera Expert

Hi,

Requirement:- When user select "Purpose" field as 'Automotive build-up' then above "Select OUC" all value should be clear and only shown some specific 6 records from that table after click on magnify glass icon, there is already configure Reference Qualifier query. below ss are available for reference.

Screenshot (23)_LI.jpg

 

existing query on reference qualifier.

Omkarbh1997_0-1737012097146.png

 

Thank You.

 

1 ACCEPTED SOLUTION

@Omkarbh1997 

As per my understanding you want to display the existing query and if the purpose field is automotive build up then you want to add some other query.

If that's the case then modify the reference qualifier by adding the existing query as shown below.

javascipt:current.variables.purpose == "sys_id_of_automotive_build_up" ? "add encoded query": "add existing encoded query";

Hope this helps!

 

"If you found my answer helpful, please like and mark it as an "accepted solution". It helps future readers to locate the solution easily and supports the community!"

 

Thank You
Juhi Poddar

View solution in original post

9 REPLIES 9

Brad Bowman
Kilo Patron
Kilo Patron

You can do this all in an Advanced Reference qualifier, but it will be easier in a Script Include.  Switch the qualifier to advanced, then copy the encoded query somewhere else for later.  Change the qualifier to call a Script Include function, passing in the name of the OUC field or variable as an argument.  The Script Include will simply return your existing encoded query if OUC is blank, otherwise it will return the 6 specific sys_ids.

Can you please provide Script for this

Juhi Poddar
Kilo Patron

Hello @Omkarbh1997 

You can try something like this in advanced reference qualifier section of variable Select OUC

javascipt:current.variables.purpose == "sys_id_of_automotive_build_up" ? "add encoded query": "";
  • current.variables.purpose : modify the field name purpose as it is in your instance
  • sys_id_of_automotive_build_up : sys_id of automotive build up record
  • add encoded query : this should be the encoded query 

Adding screenshot for better understanding:

JuhiPoddar_1-1737036125695.png

 

Below screenshot demonstrate how to copy Encoded query directly after building the query.

JuhiPoddar_0-1737035431351.png

Hope this helps!

 

"If you found my answer helpful, please like and mark it as an "accepted solution". It helps future readers to locate the solution easily and supports the community!"

 

Thank You
Juhi Poddar

 

Hi @Juhi Poddar 
I have to also mentioned the existing reference qualifier query with the above requirement, which I mentioned in the post. How should I do?