Dom Manipulation issue
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
4 weeks ago
Hello folks.
I’m facing an issue with DOM manipulation. The requirement is: based on the value selected in the Service field, I need to populate the related Name in a specific tab of the Case record. This tab should display the name that is linked to the selected service. I tried using a GlideAjax call within an onChange client script, but it’s not working. The goal is to have the name in that tab automatically populated according to the selected service.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
4 weeks ago - last edited 4 weeks ago
Attaching the snips here.. Here the tab only shows the name as case, instead of related name of the service line tab.
Any other suggestions @Ankur Bawiskar
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
4 weeks ago
based on field change what you want to do?
why DOM is required?
If you are trying to change the display value of reference field on the fly using DOM then it's not recommended and may not work.
That's not how Reference field works.
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
4 weeks ago
Based on the value selected in the Service Line reference field, I need to display a related list tab that corresponds to that specific Service Line. I tried using DOM manipulation to capture the Service Line and update the tab with the corresponding field name, but I couldn’t get it to work it always defaults to showing Case.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
4 weeks ago
Based on field change you need to display a related list tab OR form section?
From your image it looks like a form Section for Case, so you can use this syntax to show/hide the form section
g_form.setSectionDisplay('case', true);
The section name is the lowercase text for the text.
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
4 weeks ago
Hiding and showing the section works fine, but dynamically changing its name is the issue. Instead of displaying the updated name, it keeps showing the default Case in the section, which is causing the problem.