The CreatorCon Call for Content is officially open! Get started here.

dynamic filter option on reference field

Rj27
Mega Guru

Hi All,

Can we define dynamic filter option on 'requested for' reference field as shown?
Can we use 'current' this way directly? Because the following script is not working at all.
Note: I am using this under default value related list with a reason to set default values when i click on lookup option. From reference qualifier i am returning something else and can't define the default values there.

find_real_file.png

 

find_real_file.png

38 REPLIES 38

I am calling it from dynamic filter option 9from default value related list option) not dynamic ref qualifier.. i am already using advanced ref qualifier to return certain set of values.

I doubt dynamic filter can be used for the same else i would have atleast got the log.

Hi,

from the script include you are returning the query

Can you share from where you are calling with screenshot

Regards
Ankur

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

I am calling the script include from dynamic filter option. screenshot i have attached above this comment.

I also tried with client callable option but that's not working either.

Now i doubt dynamic filter can be used for the same else i would have atleast got the log.

@Rj27 

Can you explain what exactly is required with screenshots?

Regards
Ankur

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

For a reference field 'requested for', I am trying to use dynamic filter option under default value related list.


I could have used advanced reference qualifier but the problem is there is already a script that is returning some set of user values(let's say 10users).

But initially, i want a default value of only 5 specific users to display on lookup(these 5 users are subset of users returning from advanced ref qualifier).
All 10 users should be visible only when we manually give filter condition.

So i am trying to handle this by using default value to first display 5users and later if i give the required filter all 10 users should be displayed.

Script written on advanced ref qualifier:

query = 'active=true^sys_domain=' + current.sys_domain + '^ORsys_domain=' + user.sys_domain;

return query.toString();

 

Script trying to return from dynamic filter:

query = 'active=true^sys_domain=' + current.sys_domain;


return query.toString();