how to mandate reason for change rejection ?

karan15
Tera Contributor

HI Need help 

 

I am able to configure UI policy where in if someone is rejecting a change by going into approvals then it will ask for reason or comments for rejection (attachment 1)

 

However i noticed that when a approval right clicks and reject a change (attachment 2) it does not ask fro reason but straightway rejects the change 

 

how to ensure every time change is rejected it asks for a reason , weather its rejected by right click 

1 ACCEPTED SOLUTION

AnveshKumar M
Tera Sage
Tera Sage

Hi @karan15 ,

You can try creating a business rule like the one below, so that It will if the comments are filled in or not for rejection, and prevents rejecting the approval from Right Click even.

 

AnveshKumarM_0-1679627199054.png

 

And, use the code below in Advanced Tab, business rule script.

(function executeRule(current, previous /*null when async*/) {

	if(gs.nil(current.comments)){
		gs.addErrorMessage('Please fill comments with reject reason. Please open the approval record and fill in the comments to reject.');
		current.setAbortAction(true);
	}

})(current, previous);

AnveshKumarM_1-1679627271830.png

 

Thanks,

Anvesh

Thanks,
Anvesh

View solution in original post

6 REPLIES 6

Abhay Kumar1
Giga Sage

@karan15 you will have to add onCellEdit client script on the approval table where you make use g_form.setMadatory('field_name',true);

So it will not allow to reject in list view.

Hope this will help you.

thanks can i get more info on CellEdit client script on the approval table  on how to configure it please 

@karan15 please follow this article video a good demonstration about how to create onCellEdit client script.

can you please share link to article video thanks