Dom Manipulation issue
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
a month 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
Any assistance would be much appreciated!!
@Ankur Bawiskar
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
4 weeks ago
If your agent wants to see other field value from the referenced table then why not bring that field on form as dot walked and make it readonly.
your purpose is solved.
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 - last edited 4 weeks ago
It’s not about adding a field it’s about renaming an existing form section based on the Service Line selected above. The form section itself already contains certain fields, so I can’t simply make it a new field. Essentially, it’s a user experience enhancement where we highlight this section and add additional fields to it depending on the selected Service Line.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
4 weeks ago
So dynamically you want to add some field in that form section? If yes then that's not possible.
Form Section needs to have that field and based on your condition, you can show/hide it.
You want name of form section to be changed using DOM?
If yes then I won't recommend this
But this worked for me, Ensure Isolate Script=False for your client script for DOM to run
$j('span.tab_caption_text').each(function() {
var currentText = $j(this).text().trim();
if (currentText === 'Cause') {
$j(this).text('New Cause');
}
});
Output:
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