Possible to change displayed value on reference field on same table reference on a record?

JohnDF
Mega Sage

Hi everyone,

 

I need to change the display value of a reference field on case table.

 

JohnDF_0-1695115554006.png

Both fields a reference on asset table and I have set the serial number as display value for the asset table. But the problem is in the suggested spare part field are somethimes are asset which dont have seril number and than is the display field empty. How can I change the fields dispaly value for example to the display_value field on the case form for this requirement?

 

Thanks for your help.

1 ACCEPTED SOLUTION

Hi @JohnDF 

 

You can refer the below link...

 

There in one of the reply i have provided the same solution

 

https://www.servicenow.com/community/riseup-with-servicenow-forum/regarding-client-script/m-p/267389...

 

Vishal Birajdar
ServiceNow Developer

I know one thing, and that is that I know nothing.
- Socrates

View solution in original post

5 REPLIES 5

Vishal Birajdar
Giga Sage

Hi @JohnDF 

 

If my understanding is correct , you have one reference field on form which  refering the same table.

If this is the case then , you can't have two display value at a time.

 

If possible you can create one new field on form and onChange of "suggested spair part" you can display value in new field.

 

Vishal Birajdar
ServiceNow Developer

I know one thing, and that is that I know nothing.
- Socrates

JohnDF
Mega Sage

@Vishal Birajdar thanks for reply,

 

how can I achieve this? Can you assist me with code? onChange of the field "suggested spair part" the selected record should show for exampl the field from asset table dispaly_value.

 

Thanks for your help.

Hi @JohnDF 

 

I think you can get field on form by dot walking.If this works for you then no need to write script as well.

 

Step 1: Open form and by right clicking select configure >> form layout

Step 2: Select "suggested spair part" , you will get the (+) icon in the middle of picker

Step 3: Select the (+) icon and left side you will get the all the field

Step 4: Select the field you want to get on form and get it on right side.

Step 5: on right side get that field below "suggested spair part".

 Save the changes...

 

Now whenever you select spair part the field on form , the field you just got will get populated automatically.

 

 

Vishal Birajdar
ServiceNow Developer

I know one thing, and that is that I know nothing.
- Socrates

Hi @JohnDF 

 

You can refer the below link...

 

There in one of the reply i have provided the same solution

 

https://www.servicenow.com/community/riseup-with-servicenow-forum/regarding-client-script/m-p/267389...

 

Vishal Birajdar
ServiceNow Developer

I know one thing, and that is that I know nothing.
- Socrates