Notifications

34 views

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

Seen In

There is no data to report.

Associated Community Threads

There is no data to report.

Article Information

Last Updated:2019-05-21 11:43:13
Published:2019-04-30