- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-27-2016 12:09 PM
Hi,
I came across one scenario while form designing and have one question on it:
- How to relabel a dot-walked field on a table-form by creating Language File (sys_documentation) record for that field on its respective table. e.g - there is a dot-walked field: x_qui_case_sfdc_case.contact_name.department.u_business_unit.u_description on our "SDFC Case" form which gets displayed on the form as "Description". We want to relabel it to something meaningful like "Business Unit" etc. I tried creating a Language File record (like we do normally for overriding label of any parent-table field at child table) but it didn't work out.
I understand - we can relabel it using script as suggested in following article: Modifying the Label of Form Fields With Client Scripts - ServiceNow Guru. I was trying to search a conventional way of relabeling fields (please find following article: Introduction to Fields - ServiceNow Wiki ) prior to opting for any custom scripting.
Any suggestion would be helpful.
Thanks,
Hitesh
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-27-2016 12:19 PM
Hi Hitesh,
From what I can tell, you need to use the scripting method (g_form.setLabelOf()).
When you go to Configure> Label, it wants to modify the label on the "source" table. In my example, I dot-walked to caller_id.department on the incident form and took a look at the label definition. No luck. There's an incident.department, but that's a different field (not currently on the form.)
Reference:
GlideForm (g form) - ServiceNow Wiki

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-27-2016 12:19 PM
Hi Hitesh,
From what I can tell, you need to use the scripting method (g_form.setLabelOf()).
When you go to Configure> Label, it wants to modify the label on the "source" table. In my example, I dot-walked to caller_id.department on the incident form and took a look at the label definition. No luck. There's an incident.department, but that's a different field (not currently on the form.)
Reference:
GlideForm (g form) - ServiceNow Wiki
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-27-2016 02:04 PM
Thanks Chuck for your quick response. The code snippet you shared is helpful to change the label of the field on form. But this script (OnLoad Client Script if I am not wrong) would not be much helpful when we try to access the field in lists or reports.
I found one more idea to create a new custom field named "Business Unit" and put a calculation at the dictionary for this field as something like:
current.contact_name.department.u_business_unit.u_description
Do you thing that would be helpful?
Thanks,
Hitesh

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-27-2016 02:07 PM
Hi Hitesh,
Great idea. I love the innovative thinking! That also allows you to label it anything you like since the field is now on that table. Let me know how it works.
Don't forget to test it by changing the value of the contact_name and elements further down the line (e.g. if the contact name changes departments, does it stay up to date?)

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-27-2016 02:32 PM
Let me know if I have answered your question. If so, please mark my response as correct so that others with the same question in the future can find it quickly and that it gets removed from the Unanswered list.
If you are viewing this discussion from your "inbox", use the "mark as correct" option under actions. If you are viewing it directly from the thread use the Correct Answer link (red with a star).
Thank you