Reference qualifier dot-walk from a reference field

Desmo
Mega Guru

Hello Community,

I have reference field with a reference qualifier of:

Valid

javascript: "contractLIKE" + current.contract.getDisplayValue();

 

I need help with adding an OR condition that dot-walks to another reference field [sys_user]--get users with the company matching the current company in the record. I need

Invalid

javascript: "contractLIKE" + current.contract.getDisplayValue() + "^ORuser.companyLIKE" + current.company.getDisplayValue();

 

Thank you.

1 ACCEPTED SOLUTION

Ankur Bawiskar
Tera Patron
Tera Patron

Hi,

update as this

javascript: "contractLIKE" + current.contract.getDisplayValue() + "^ORuser.company.nameLIKE" + current.company.getDisplayValue();

Regards
Ankur

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

Hi,

update as this

javascript: "contractLIKE" + current.contract.getDisplayValue() + "^ORuser.company.nameLIKE" + current.company.getDisplayValue();

Regards
Ankur

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

@Ankur Bawiskar  Thank you.

 

In the above scenario, the field is referencing Users Covered[clm_m2m_contract_user], which has a Contract field. The OR part was meant to get results from the User [sys_user] table.

Is it possible to have a single reference field that can reference two or more tables and show all matching results? Basically, combined list and independent of each other.

1 reference field can refer only 1 table at a time because that is how it is configured in dictionary

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

Abhijit4
Mega Sage

Hi

You can try below.

javascript: "contractLIKE" + current.contract.getDisplayValue() + "^ORuser.companyLIKE" + current.company;

Instead of going for display value, we should use sys id's for comparison as display name could have multiple records.

Let me know if you have any further queries.

Please mark this as Correct or Helpful if it helps.

Thanks and Regards,
Abhijit

By marking my response as correct or helpful, you contribute to helping future readers with similar issues.
Regards,
Abhijit
ServiceNow MVP