Reference field being set by business rule is getting sys_id but it's not displaying correctly

e_wilber
Tera Guru

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):

e_wilber_0-1691158225474.png

The field data looks like: 

e_wilber_1-1691158263608.png

 

//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

Samaksh Wani
Giga Sage
Giga Sage

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

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.

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

 

 

Maik Skoddow
Tera Patron
Tera Patron

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.