How to remove info messages

amaradiswamy
Kilo Sage

Hi All,

I have written an before update business rule to make the changes not saved if particular condition matches at the time of closure. It is working as expected. it is throwing some error message so that user can check the reason, but along with the error message i am getting "Problem resolved" message also which was mentioned in "Resolve problem" UI action .

Business rule logic:

  current.setAbortAction(true);

  current.state = previous.state;

  gs.flushMessages();

  gs.addErrorMessage('This ticket can not be closed until the related '+itcc.number+ ' is closed');

  action.setRedirectURL(current);

UI action script at the end:

if (typeof window == 'undefined')

    serverReopen();

function serverReopen() {

    // Set Incident state to active, update and reload the record

    current.state = 11;

    current.update();

    gs.addInfoMessage(gs.getMessage("Problem resolved"));

    action.setRedirectURL(current);

}

Please helpme to overcome this issue.

Thanks and regards,

Swamy

6 REPLIES 6

Pradeep J
Kilo Guru

Hi




Can you just comment the line and try



gs.addInfoMessage(gs.getMessage("Problem resolved"));



Thanks


Pradeep D J



PS - Please mark Helpful, Like, or Correct Answer if applicable.


It's probably this line you need to change, but if you comment it it'll never show, instead you'll have to put in logic to only post the message when there are no other errors being triggered.