Remove reference qualifiers when a condition is met

Elvin_Salim
Tera Contributor

How to remove a reference qualifier from field "b" if field "a"=true on scoped app? I'm trying to do it by onChange client script, which doesn't work.

1 ACCEPTED SOLUTION

@Elvin_Salim 

then use this

javascript: var query = ''; if(current.fieldA.toString() = 'false') query = new My_All_Cases().filterByRegion(current.u_filtered_cases); query;

If my response helped please mark it correct and close the thread so that it benefits future readers.

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

View solution in original post

4 REPLIES 4

Ankur Bawiskar
Tera Patron
Tera Patron

@Elvin_Salim 

you cannot update reference qualifier using onChange script

what's your actual business requirement? share some screenshots.

If my response helped please mark it correct and close the thread so that it benefits future readers.

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

Hi @Ankur Bawiskar ,

 

Field "a" is a true/false field.

Field "b" is a reference field to the "All Cases" table and there is a reference qualifier in field "b" that filters records based on the region of the logged in user:  --- javascript: new My_All_Cases().filterByRegion(current.u_filtered_cases);

 

What I'm trying to do is that when field "a" is true, the reference qualifier will not apply.

@Elvin_Salim 

then use this

javascript: var query = ''; if(current.fieldA.toString() = 'false') query = new My_All_Cases().filterByRegion(current.u_filtered_cases); query;

If my response helped please mark it correct and close the thread so that it benefits future readers.

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

@Ankur Bawiskar ,

 

Thanks a lot. It solved the issue.

 

BR,

Elvin