I have a question regarding the warning or notification banner that appears in UCI.
The warning banner appears as highlighted in the image.
That notification appears automatically. I could not find any related JS code where that banner is set or called.
Is there a way to change the background color of that banner?
In Legacy, the background color of the banner is this:
Is there a way to change the background color of the warning/notification banner?
a2z
Hello, I've initiated an idea related to this here Microsoft Idea · Form Notification default color change and ability to customize it (dynamics.com)
Please vote if you agree!
Hi a2z,
Having searched many links and pages in recent days, I am afraid that currently there is no OOTB setting for us to change their color.
Regards,
Clofly
I did something very similar to what you did as a last resort.
However, I am trying to minimize or limit unsupported change and have instead informed the clients the banner colour is OOTB.
Thanks
a2z
Hi a2z,
Currently there is no OOB setting for us to change the background color of the warning/notification banner.
You could change color with unsupported way, but the JavaScript function should be added to each form.
My method is by injecting a custom CSS style node into HTML/document, the node contains rules to overwrite background color of banners, banner elements are selected by id and attribute selector.
function createStyle() {
var customStyle = '#footerWrapper > div { background-color: #fab1a0!important }';
customStyle = ' div[role="alert"] > li { background-color: #74b9ff!important }';
var css = document.createElement('style');
css.type = 'text/css';
css.innerHTML = customStyle;
parent.document.head.appendChild(css);
}
Result:
Regards,
Clofly
As far as I know there is no supported way to do this.
Thanks Aric. I am aware of the setFormNotfication but that banner appears automatically for inactive records.
But my question is about that banner that is shown for inactive records. Can that banner background color be changed? Can someone confirm that this can't be changed?
Thanks
a2z
That banner is only shown for Inactive records.
When you display your own banners such as Information, Warning and Error banners you can use the setFormNotification and clearFormNotification functions:
docs.microsoft.com/.../setformnotification
These are the notifications you will see on the form. You pass the message, level and unique id. The level specifies the icon that will be displayed for INFO, WARNING or ERROR. The unique id is used for when you want to clear it.
You can also use the Global Notification which is systemwide.
docs.microsoft.com/.../addglobalnotification
Hope this helps.
Stay up to date on forum activity by subscribing. You can also customize your in-app and email Notification settings across all subscriptions.
André Arnaud de Cal... 290,936 Super User 2024 Season 2
Martin Dráb 229,378 Most Valuable Professional
nmaenpaa 101,156