error in reference qual?

Julius28
Tera Expert

Hi!

 

I'm updating Look up select box reference qual with parameter Operational status is not Retired but something is odd and not working. Can someone can spot mistake?

 

This is for first field:

javascript:'u_active=true^u_region=pb^u_service_id.operational_status!=4^EQ'

 

This is for second field:

javascript:'u_db_name='+current.variables.select_db+'^u_active=true^u_region=pb+'^u_service_id.operational_status!=4^EQ'

 

 

Thanks.

1 ACCEPTED SOLUTION

Community Alums
Not applicable

Remove both " + " and " ' " (+') - its not correct as you are concatenating to pb the plus sign and you close your string query by adding single quote and not closing it correctly. What happens is that you pass to the DB query like "gimme me active to be true and region to be pb+" here you end your string query and add ^u_service_id...so on. The syntax is incorrect in general as you need to concatenate stringified queryes with + and then use either variables, javascript calls or just add extra stringified query (like "active=true" + "region=pb", but not "active=true+"^region=pd -> this is very wrong syntax.

View solution in original post

7 REPLIES 7

Community Alums
Not applicable

See, easiest way to check if you reference qualifier (refQual) is working is to open the referenced table in list view. Then just add your query directly to the filter (using SNUtils , in the URL, background script or other way - I can think of 2 more but those are a bit extreme and guru level to use). Example in pic.1 for SNUtils.

This way you will be sure that it will work. Use some hardcoded values for the variables (like if current.variables.user is used replace it with sys_id or value in other use cases).

Example for background script in pic.2. For URL in pic.3

JoroKlifov1_0-1715185959750.png

 

JoroKlifov1_1-1715186119301.png

 

 

 

JoroKlifov1_2-1715186152069.png

 

Maddysunil
Kilo Sage

@Julius28 

The issue with your reference qualifier script for the second field seems to be a syntax error in the concatenation of the query. It seems there's a misplaced plus sign (+) after u_region=pb.

Try with below

 

javascript:'u_db_name=' + current.variables.select_db + '^u_active=true^u_region=pb^u_service_id.operational_status!=4^EQ'

 

Please Mark Correct if this solves your query and also mark 👍Helpful if you find my response worthy based on the impact.

 

Thanks

Ranjit Nimbalka
Mega Sage

Hi @Julius28 ,

 

use below reference qualifier:-

1.This is for first field:

javascript:'u_active=true^u_region=pb^u_service_id.operational_status!=4^EQ'

2.This is for second field:

javascript:'u_db_name=' + current.variables.select_db +'^u_active=true^u_region=pb^u_service_id.operational_status!=4^EQ'

 

whenever you want to validate reference qualifier script copy and paste into background script from color you can understand.

 

If my answer has helped with your question, please mark my answer as accepted solution and give a thumb up.
Regards,
Ranjit