Reference field being set by business rule is getting sys_id but it's not displaying correctly
Options
- 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?
5 REPLIES 5
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-04-2023 10:59 AM
Hi @e_wilber ,
Hope you are doing well.
Try using below script for setting the reference field value:
var wot = new GlideRecord('wm_task');
wot.initialize();
wot.parent = ev.u_work_order;
wot.setValue('u_patient', ' <sys id o patient which your want to set>' )
wot.insert();
And also make sure to check the referencing table has exactly once column with display ="true".
Please mark the appropriate response as correct answer and helpful, This may help other community users to follow correct solution.
Regards,
Riya Verma
Regards,
Riya Verma