Description
Using an addInfoMessage to show an information message at the top of the form, shows up multiple times
Steps to Reproduce
- 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
- 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
- Go to sys_update_set.list
- Open an existing record
- 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