make mandatory additional comments in approval

armanoj
Mega Sage

Hi , 

in approval table make comments mandatory when they get approve , but get another error message along with custom error message  as "Invalid value on Update". Usinge BR I tried to make comments mandatory.

if (gs.nil(comments)) {

        current.setAbortAction(true);
        gs.addErrorMessage('Comments are mandatory when approving or rejecting.');
        return;
    }


is it possible remove that error message.
armanoj_0-1781694154871.png

 



8 REPLIES 8

Mark Manders
Giga Patron

Everything they added, will be reversed. You would better just use a UI policy to make comments mandatory. 

Attachments are handled differently, so you would need a business rule for that. However, it's strange that an approval would need a mandatory attachment. 


Please mark any helpful or correct solutions as such. That helps others find their solutions.
Mark

I used BR to make attachment mandatory its working fine but getting one more error message . @Mark Manders 

Without sharing the error message or showing what you did, it's impossible to even start guessing what is going on.


Please mark any helpful or correct solutions as such. That helps others find their solutions.
Mark

Ankur Bawiskar
Tera Patron

@armanoj 

from where are the users approving or rejecting?

Portal or native?

Regards,
Ankur
Certified Technical Architect  ||  10x ServiceNow MVP  ||  ServiceNow Community Leader