Requestor cannot approve their own request

angelawells
Giga Contributor

I want to prevent a change requestor from being able to approve their own change request.  I tried a "before" business rule but it didn't give me the result that I was looking for.  The person is a member of the approval group for the particular type of change; however, if he is the requestor and he tries to approve he should get a message that "You are not allowed to approve your own change requests" but only if he tries.  It will automatically go to "no longer required" if one of the others in the group approve it. 

3 REPLIES 3

SanjivMeher
Kilo Patron
Kilo Patron

You can use before business rule.

 

if (current.sysapproval.sys_class_name =='change_request' && current.approver == current.sysapproval.requested_by)

{

current.setAbortAction(true);

gs.addErrorMessage('You are not allowed to approve your own change requests');

}


Please mark this response as correct or helpful if it assisted you with your question.

angelawells
Giga Contributor

This doesn't give me the desired results.  When I test it even though I'm not the requestor when I change it to the state to trigger the approvals I get the message about 15 times "you are not allowed to approve your own request".  I only want a popup if the requestor tries to approve it.

Can you post a screenshot of you business rule?

 

And a screenshot of you approval record


Please mark this response as correct or helpful if it assisted you with your question.