- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-21-2015 11:45 AM
In our Fuji environment, I have a page within a module that runs two client scripts. Each script runs g_form.addErrorMessage(...) in the OnLoad event to display an message to the user. In one environment this works as expected; the user sees the two error messages at the top of the page above the page controls which appear below them.
However in a separate Fuji environment, the error messages are duplicated. There are two of each displayed making a total of 4 error messages at the top of the page. It seems as of the OnLoad event is running twice.
If the scripts were not in the OnLoad event I would think perhaps they were being called from somewhere I am not aware of. But since they are in the OnLoad event I'm not quite sure where to go from here.
Any suggestions on where to check for these scripts being called, or why an OnLoad script would run twice would be most appreciated. I am fairly new to ServiceNow so apologies if I have neglected to provide any piece of fundamental information.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-21-2015 12:27 PM
I would start by turning the one you know about off and see if you still get two messages or no message. If you get 2, it means you have a duplicate somewhere. If you get none, it means there is something in your script that is not acting correctly.
Also, please post screenshots of your client script, or a close proximate of it. This will help us rule that particular piece out.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-23-2015 06:10 AM
Disabling some of the scripts helped confirm that there were indeed duplicates running somewhere else. Once confirmed, I knew that searching existing scripts more thoroughly would likely help identify the culprits. In fact that did happen and the duplicates were identified and removed. All is well now. Thank you for the advice and guidance, to Mike and all who responded.