
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-07-2017 05:50 AM
Been here: Defining Field Styles - ServiceNow Wiki
Been here: Field styles are not getting applied
Still no go. What's funny is in the supposed answer for Field styles are not getting applied that Pradeep gave, his screenshot doesn't even show what it took.
Anyway... my situation:
As you see, no background-color red.
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-15-2017 06:03 AM
Yes yes, I agree with all that. My apologies for trying to beat this dead horse.
I found a non-DOM solution:
g_form.flash('u_nonit', '#ad7', 0);
g_form.flash('u_nonit', '#ad7', 0);
(found here: https://community.servicenow.com/thread/164290 )
btw...
Look forward to seeing you at K18!

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-09-2017 06:00 AM
Hi David,
I always caution people when I see the use of DOM manipulation (document.getElementByID). This is at risk of not working in future releases. See if you can get it to work using g_form.getControl() instead.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-14-2017 07:23 AM
I agree, Chuck, but the following doesn't work:
g_form.getControl('label.u_invoice_tracking.u_nonit').setAttribute('style', 'background-color: #ad7; color: #000; padding: 3px;');
I believe it's because getControl() is looking for field names, and what I need stylized is a field label.
Thoughts?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-15-2017 05:15 AM
I only point it out because of the risk. If it works, it works. You just need to accept the risk of testing and maintaining it going forward.
ServiceNow is a powerful platform. The good thing is "you can do anything" and the bad thing is "you can do anything." We've had a lot of customer feedback recently that state "I wish I had stayed closer to OOB instead of making so many customizations."
Just because you CAN do a thing, doesn't mean you SHOULD do that thing. Try to offer your management/decision makers: options, costs, and risks so they can make informed decisions.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-15-2017 06:03 AM
Yes yes, I agree with all that. My apologies for trying to beat this dead horse.
I found a non-DOM solution:
g_form.flash('u_nonit', '#ad7', 0);
g_form.flash('u_nonit', '#ad7', 0);
(found here: https://community.servicenow.com/thread/164290 )
btw...
Look forward to seeing you at K18!