Skip to page contentSkip to chat
ServiceNow support
    • Community
      Ask questions, give advice, and connect with fellow ServiceNow professionals.
      Developer
      Build, test, and deploy applications
      Documentation
      Find detailed information about ServiceNow products, apps, features, and releases.
      Impact
      Accelerate ROI and amplify your expertise.
      Learning
      Build skills with instructor-led and online training.
      Partner
      Grow your business with promotions, news, and marketing tools
      ServiceNow
      Learn about ServiceNow products & solutions.
      Store
      Download certified apps and integrations that complement ServiceNow.
      Support
      Manage your instances, access self-help, and get technical support.
Information messages displayed using "addInfoMessage" from a script include showing multiple times at the top of a form - Known Error
  • >
  • Knowledge Base
  • >
  • Known Error (Knowledge Base)
  • >
  • Information messages displayed using "addInfoMessage" from a script include showing multiple times at the top of a form
KB0747530

Information messages displayed using "addInfoMessage" from a script include showing multiple times at the top of a form


18533 Views Last updated : Apr 7, 2024 public Copy Permalink
KB Summary by Now Assist

Description

Using an addInfoMessage to show an information message at the top of the form, shows up multiple times

Steps to Reproduce

  1. Create a Script Include
    • Name: jjTest
    • Check "Client Callable"
    • Script:
      var jjTest = Class.create();
      jjTest.prototype = Object.extendsObject(AbstractAjaxProcessor, {
      popUpInfo: function(current){
      gs.addInfoMessage("This is just a test. Carry on!") },
      type: 'jjTest'
      }
      );
    • Save
  2. Create a UI Action
    • Name: JJ Popup
    • Table: sys_update_set
    • Action name: jj_pop_up
    • Check booleans:
      • Show Update
      • Client
      • List v2 Compatible
      • Form Button
    • Onclick: run()
    • Condition: new jjTest().popUpInfo(current)
    • Script: new jjTest().popUpInfo();
    • Save
  3. Go to sys_update_set.list
  4. Open an existing record
  5. You will notice 2 or more pop-ups at the top of the screen

Expected behavior: Only one message should show up on at the top of the screen

Actual behavior: Having multiple messages show up at the top of the screen

Workaround

This is expected behavior and by design in all currently supported releases.

Recommendation: never add messages during a server-side script call that is being used in a condition. This an anti-pattern and not recommended. Condition processing should only be used to evaluate a final answer of true or false and nothing more.


Related Problem: PRB1338885

The world works with ServiceNow.

Sign in for more! There's more content available only to authenticated users Sign in for more!
Did this KB article help you?
Did this KB article help you?

How would you rate your Now Support digital experience?

*

Very unsatisfied

Unsatisfied

Neutral

Satisfied

Very satisfied

Very unsatisfied

Unsatisfied

Neutral

Satisfied

Very satisfied

What can we improve? Please select all that apply.

What are we doing well? Please select all that apply.

Tell us more

*

Do you expect a response from this feedback?

  • Terms and conditions
  • Privacy statement
  • GDPR
  • Cookie policy
  • Cookie Preferences
  • © 2025 ServiceNow. All rights reserved.
We use cookies on this site to improve your browsing experience, analyze individualized usage and website traffic, tailor content to your preferences, and make your interactions with our website more meaningful. To learn more about the cookies we use and how you can change your preferences, please read our Cookie Policy and visit our Cookie Preference Manager. By clicking “Accept and Proceed,” closing this banner or continuing to browse this site, you consent to the use of cookies.