The message appears and then disappears immediately in production, but it works correctly in develop

tomato20250
Tera Contributor

Hi everyone,

I'm facing an issue where a server-side error message disappears almost instantly on the Production environment, while it stays visible on the Dev environment until manually closed.

Here is the UI Action code I'm using:

function runPullback() {
    var answer = confirm("Pull back confirm");

    if(answer) {
        gsftSubmit(null, g_form.getFormElement(), 'u_pullback');
    }
}

if (typeof window == 'undefined') {
    runPullbackServer();
}

function runPullbackServer() {
    gs.addErrorMessage("Pull back error");
    current.setAbortAction(true);

    action.setRedirectURL(current);
}

 

  1. Issue: When running this in the Dev environment, after clicking "Pull back", the error message appears and stays visible until I manually close it. However, on Production, the message only flashes for a split second and then disappears (as shown in the attached image).
  2. What I've checked: I have checked for g_form.clearMessages() in all related Client Scripts, but found no scripts that would clear the messages.
  3. Question: Could you please let me know what might be causing this behavior?

Thank you all!

3 REPLIES 3

Laveena-Agarwal
Mega Sage

Hi @tomato20250 

 

Check scripts under UI Policies too OR  try to perform code search via ServiceNow studio where this "clearMessages()" has been called in your entire ServiceNow platform.

 

 Thanks for your reply @Laveena-Agarwal .

 

I’ve already checked all the places related to the current page and there’s no clearMessages() being called. Could you let me know if there are any other possible causes for this issue?

 

 Thanks for your reply.

 

I’ve already checked all the places related to the current page and there’s no clearMessages() being called. Could you let me know if there are any other possible causes for this issue?