Dot Walking Element Value in Field Label (sys_documentation) Record

fpoth
Tera Contributor

I would like to know the purpose of the following Field Label record.

 

/sys_documentation.do?sys_id=6fd28dbbc611227d00b5efc8b55edf2b

 

I found this record in my instance. It was created by glide.maint in 2006 and looks like it's meant to set the label of the request.requested_for element on a sc_req_item form. It doesn't seem to work, but if it is possible to do this I would be very interested to know.

 

ServiceNow allows us to create form layouts that add fields from related tables by dot walking to them from reference fields. For example, if you want to add the Caller's email field from the sys_user table to an incident form, you could add caller_id.email to the form layout. Unfortunately, if you also added assigned_to.email to the same incident form, both fields would have the same label, which is confusing.

 

Being able to create a sys_documentation record that sets the label for an element from a related table would be very useful, and it seems like that might have been the intent behind the record I found in my instance.

 

Does anyone know what the purpose of this record is or how to create a label for a form field from a related table?

1 REPLY 1

Basheer
Mega Sage

Hi @fpoth 

For how to create a label for a form field from a related table?

As per my view if the field is not extended at the table level then you can only do dot-walking.

 

Use g_form.setLabelOf('column_name','Mention your label') to change labels via client script - Not possible because the field is not present on the form itself.

 

If you need to have a mapping then create a field on the table and give it a proper name and do the coding via Client Scripts and Business rules as per your requirement.

 

Unfortunately, if you also added assigned_to.email to the same incident form, both fields would have the same label, which is confusing. --> For this you can change the labels from the dictionary's related list or even through client script setLabel method.

 

Please hit like button if my suggestion has helped you in any way.
Please mark correct if my response has solved your query.

Cheers,
Mohammed Basheer Ahmed.