Comments on: UI Info and Error Message Cheat Sheet https://servicenowguru.com/scripting/ui-info-error-message-cheat-sheet/ ServiceNow Consulting Scripting Administration Development Wed, 06 Mar 2024 19:40:23 +0000 hourly 1 https://wordpress.org/?v=6.8.2 By: Mark Stanger https://servicenowguru.com/scripting/ui-info-error-message-cheat-sheet/#comment-9379 Mon, 06 Feb 2017 15:59:37 +0000 https://servicenowguru.wpengine.com/?p=4576#comment-9379 In reply to Subramani Kumarasamy.

This might change depending on what version of ServiceNow you’re running, but on the Helsinki version I’ve got as a sandbox you can use an ‘OnLoad’ client script with the following code to hide the close button in the info message container.

$('output_messages').select('button')[0].hide();
]]>
By: Subramani Kumarasamy https://servicenowguru.com/scripting/ui-info-error-message-cheat-sheet/#comment-9378 Fri, 03 Feb 2017 12:43:15 +0000 https://servicenowguru.wpengine.com/?p=4576#comment-9378 How to disable the close option in addInfoMessage. If we use addInfoMessage(“Hi How are you”). It will be displayed at the top of the form and user has an option to close this message.

My requirement is like to make the Message permanently at the top of the form.
Please anyone help me to achieve this.

]]>
By: Mark Stanger https://servicenowguru.com/scripting/ui-info-error-message-cheat-sheet/#comment-9377 Thu, 02 Feb 2017 13:36:12 +0000 https://servicenowguru.wpengine.com/?p=4576#comment-9377 In reply to Christopher Jordan.

None that I’m aware of, but I haven’t had any opportunity to dig into the API. You might get another opinion on the SN community.

]]>
By: Christopher Jordan https://servicenowguru.com/scripting/ui-info-error-message-cheat-sheet/#comment-9376 Wed, 01 Feb 2017 20:04:10 +0000 https://servicenowguru.wpengine.com/?p=4576#comment-9376 Is there a way to extend the addInfoMessage duration? I was hoping it would take an additional parameter like the number of ms or seconds to keep it up without requiring interaction.

]]>
By: Mark Stanger https://servicenowguru.com/scripting/ui-info-error-message-cheat-sheet/#comment-9375 Sat, 21 Jan 2017 02:38:21 +0000 https://servicenowguru.wpengine.com/?p=4576#comment-9375 In reply to John.

The only ways to do this are to set up the field message in an ‘onChange’ script so that it’s evaluated each time the field changes (and re-displays accordingly) or to avoid field messages entirely and just use an annotation if the message is always supposed to be there.

]]>
By: John https://servicenowguru.com/scripting/ui-info-error-message-cheat-sheet/#comment-9374 Sat, 21 Jan 2017 00:54:12 +0000 https://servicenowguru.wpengine.com/?p=4576#comment-9374 Mark, is there a simple way to make the showFieldMsg() messages permanent? All of mine go away after the field they’re attached to is changed.

For example, if I add one to an email address field then you type something in that field and blur it, the message goes away. I want it to stay there permanently.

]]>
By: Mark Stanger https://servicenowguru.com/scripting/ui-info-error-message-cheat-sheet/#comment-9373 Thu, 18 Feb 2016 18:31:16 +0000 https://servicenowguru.wpengine.com/?p=4576#comment-9373 In reply to William Smith.

Looks like the support for this in client-side messages has been removed in the Geneva release. You can’t inject your own html anymore using the basic methods unfortunately. I’ve updated the documentation above to reflect this. If you’d like to see the behavior in Geneva you’ll need to contact ServiceNow support to see about an enhancement.

]]>
By: William Smith https://servicenowguru.com/scripting/ui-info-error-message-cheat-sheet/#comment-9372 Thu, 18 Feb 2016 14:23:57 +0000 https://servicenowguru.wpengine.com/?p=4576#comment-9372 Hi Mark, it appears some of the CSS coding changed in Geneva. I am getting an error when attemping to apply CSS to the info message in your example. Could you tell me what the updated code would be for: g_form.addErrorMessage(‘[b]Form Error Message Text (Bold)[/b]’); ?

I have a note for a different CSS styling that I found, which may help with the styling…

Set field width:

Fuji: https://servicenowguru.com/system-ui/field-styles-service-catalog-variables/
g_form.getControl(‘VARIABLE_NAME’).style.width = ‘150px’;

Geneva: https://community.servicenow.com/message/881984#881984
g_form.getControl(‘VARIABL

]]>
By: Mark Stanger https://servicenowguru.com/scripting/ui-info-error-message-cheat-sheet/#comment-9371 Mon, 08 Sep 2014 19:49:07 +0000 https://servicenowguru.wpengine.com/?p=4576#comment-9371 In reply to How we can remove or hide the server UI messages?.

Clearing messages (server-side or client-side) is accomplished via the ‘GlideUI.get().clearOutputMessages();’ call shown above in the client-side section.

]]>
By: How we can remove or hide the server UI messages? https://servicenowguru.com/scripting/ui-info-error-message-cheat-sheet/#comment-9370 Mon, 08 Sep 2014 14:29:14 +0000 https://servicenowguru.wpengine.com/?p=4576#comment-9370 How we can remove or hide the server UI messages?

]]>