Using a reference field in the condition field on a UI action.

Julian Harris
Mega Contributor

I have a UI action that I only want to execute based on the value of a field on the incident form.

 

The field I am looking at is called u_symptom and is a reference field.  I tried using the syntax:

current.u_symptom== 'Event Management'

But as this is the label it's failing.  Has anyone used a reference field in the condition field in a UI action, if so, could you let me know how you got around this problem.

 

Thanks

1 ACCEPTED SOLUTION

Sachin Pratap 2
Kilo Expert
Hi Julian,

 

When you use current.u_symptom, output is sys_id of the Event Management record.

 

So you can use any of the following two methods:

1) current.u_symptom=='sys_id_of_Event_Management_record'

 

2) do an extra dot walking to and get display value

current.u_symptom.getDisplayValue()== 'Event Management'

 

Please mark correct, if this resolves your issue.

 

 

Regards,

Sachin

View solution in original post

6 REPLIES 6

AbhishekGardade
Giga Sage

Hello Julian,

Whenever you are dealing with any reference field from script,it always return a sys_id. 

Always you need to match with the sys_id of the record in order to compare with any value.  Display name can be changed any time but you never change the sys_id of the record as its unique.

current.u_symptom=='sys_id_of_Event_Management

Please mark as Correct Answer and Helpful, if applicable.
Thank You!
Abhishek Gardade

 

Thank you,
Abhishek Gardade

Thanks Abhishek