Tony Chatfield1
Kilo Patron

Hi, perhaps an underpinning refqualifier that returns all the required data from both domains, and then a default list filter set to show results where Company IS D2. You can then change this default filter to Company IS DI on the fly, or remove it to see all results from the refqual.

Hi Tony,

Thanks for the response!

Can you please elaborate on what does underpinning a reference qualifier mean?

Hi, the reference qualifier you applied to the list would need to return all possible record results, then you would set a default filter to show only a subset of the refquals data.
IE refqual returns records for D1 and D2, the default list filter then shows only D2 results, but you can manaully change the filter to show D1 results or both D1 and D2 results. Regardless of changes to the default filter users will never see data that was not returned by the original (underpinning) reference qualifier (D1 and D2).

Hi Tony,

Thanks for the clarification.
But it seems if i define both default filter and reference qualifier, the script calling from ref qualifier (which is returning all the values) is overriding the values returning from default filter(which is returning subset of values).

i have written following scripts.
1. Script include being called from ref qualifier:

var user = new GlideRecord('sys_user');
user.get(gs.getUserID());

var query = '';
query = 'active=true^sys_domain=' + current.sys_domain + '^ORsys_domain=' + user.sys_domain;
return query.toString();

 

2. Dynamic default filter:
This doesnot seem to work at all.

find_real_file.png

 

Bhagyashri Sort
Kilo Guru

Hi,

 You can use the reference qualifier to get the filtered data on reference field.

https://www.youtube.com/watch?v=6V1Vf-pk1wc

https://docs.servicenow.com/bundle/orlando-platform-administration/page/script/server-scripting/conc...

 

Mark it correct and helpful.

Thanks

Bhagyashri Sorte.