Approval widgets saving comments more then once

vikrantsharma
Kilo Guru

Hi All,

We had a requirement of adding comments for the approval being rejected, on the Approval widget on service portal.

I came up with adding a textbox, on the widget for every approval on the form. This makes the reject button disable, until there is some context added in the textbox and you need to add some text to reject the comments.

I am passing the comments then with the same function that is passing the state of the approval, reject or approved.

Everything is working fine, except, the comments are being saved around 6 times minimum for a single reject or approve.

I am not able to figure out why this is happening, as the state is being changed only once, which would make sense as the code which looks for the approval with requested type has already been changed by the server script. But the comments keep been added. But I don't understand why the code still keeps running and calling the script.

I have attached the widget on which I have made changes. Can I request some assistance on this please, any suggestion would be appreciated?

 

Regards,

Vikrant Sharma

Please make it correct or helpful if this solves or help you with your issue for other to make use it.

Thanks & Regards,
Vikrant Sharma
5 REPLIES 5

Thank you, heikomeyn!!!