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  

Hide empty reference field

Diana27
Tera Guru

Hi,

 

I have 2 reference variables.  Variable A and Variable B.  Variable A is a reference to cmn_cost_center.   Variable B is a reference to a custom table and has a reference qualifier for Variable A.  When the user selects an option from Variable A it populates Variable B with a list of items associated to Variable A for the user to select.   That is working correctly.   

 

Here is what I cannot seem to get to work:

If the user selects an option from Variable A that does not have any associated items to Variable B then Variable B should be hidden.

 

What is the best way to hide Variable B if it does not get populated?

 

Thank you in advance for any assistance,

Diana 

1 ACCEPTED SOLUTION

Hi Diana,

 

This script wont work, you have to write a GlideAjax and call a script include. In there you need to mimic the same query as your Reference Qualifier (u_active=true^u_type=opex_id^u_cost_center='+ current.variables.cost_center;) and check if there are any options present to be shown in variable B, if this count is more than 0 then return back a flag value based on which you can show variable B

-Anurag

View solution in original post

5 REPLIES 5

Hi Diana,

 

This script wont work, you have to write a GlideAjax and call a script include. In there you need to mimic the same query as your Reference Qualifier (u_active=true^u_type=opex_id^u_cost_center='+ current.variables.cost_center;) and check if there are any options present to be shown in variable B, if this count is more than 0 then return back a flag value based on which you can show variable B

-Anurag