Reference field being set by business rule is getting sys_id but it's not displaying correctly
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-04-2023 07:13 AM
I have no idea what's going on.
This field is being set in a business rule (you can see there's a sys_id attached to it but it's empty):
The field data looks like:
//patient is the sys_id as a string
var wot = new GlideRecord('wm_task');
wot.initialize();
wot.parent = ev.u_work_order;
wot.u_patient = patient;
wot.insert();
Why isn't this field being set correctly?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-04-2023 07:17 AM
Hello @e_wilber
Check the field is properly referencing the table or the sysid it is showing exists in the reffered table or not.
Plz Mark my Solution as Accept and Give me thumbs up, if you find it helpful.
Regards,
Samaksh
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-04-2023 07:19 AM
The field is set up correctly. If you manually enter the person's name in the field and save it, the real name is displayed. Only when it's set through this business rule is it breaking.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-04-2023 07:23 AM
Hello @e_wilber
use this :-
wot.u_patient = patient.toString();
Plz Mark my Solution as Accept and Give me thumbs up, if you find it helpful.
Regards,
Samaksh
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-04-2023 10:36 AM
Hi
check whether the target table you are referencing has exact one column with "display" = "true". Without any display column you won't get a display value set and also in case more than one column has set the "display" = "true" it can end in the same result.