- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-14-2020 03:50 AM
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
Solved! Go to Solution.
- Labels:
-
Scripting and Coding

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-14-2020 03:58 AM
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-14-2020 04:14 AM
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
Abhishek Gardade
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-14-2020 04:14 AM
Thanks Abhishek