Approval widgets saving comments twice

Aanchal3
Kilo Contributor

Hello,   

I've updated the Approval Info widget and added a comment field, but when I add a comment and reject or accept a particular approval request, the comments are updated twice. I checked for UI Action, Client Script and others but cant find a solution.

Any suggestion would be appreciated. 

13 REPLIES 13

Hi Pavel, 

I see that you commented on a number of questions similar to this. 

A solution seems to be to comment out the line below in the Client controller. I believe the update is already being done in the Server Script. 

c.data.op = state;
c.data.state = state;
//c.server.update();

Please be sure to close down the browser completely as mentioned in https://community.servicenow.com/community?id=community_question&sys_id=bfc2a8d4dbb0f34413b5fb243996... 
Lesson the second: Always always do a hard reload when testing a change.

Please let me know if this works for you too. I haven't noticed any side effects. 

derekmacdonald
Tera Contributor

I've experienced this before, we had an 'after' business rule that was causing the issue on update. 

I'd love to hear if your resolution is different

This resolution is only related to the Approval widget itself and is a different issue to the after business rules duplicating the comments as far as I understand it. I've read other threads about that but I think with that issue it happens outside of the service portal.

Hi Derek

Thank you for your response, however in my situation it was not the case. To solve it I had to use the solution from below link:

Approval widgets saving comments more then once

I had to modify the client controller and use respone function, by some reasons it solved the issue.

 

Thanks