Approval widgets saving comments twice

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-22-2019 02:45 AM
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.
- Labels:
-
Service Portal Development
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-20-2019 08:04 AM
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-20-2019 09:30 AM
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-22-2019 03:08 PM
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-27-2019 01:15 AM
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