Users should not be able to approve their own requests

Aparna Gurav
Tera Contributor

Hello Team,

 

Can anyone suggest how to achieve this requirement?


If the approver = created by user(Requested for) then they should not be able to approve the request.

1 ACCEPTED SOLUTION

Here is a BR that I think will do the job.

 

Condition: current.source_table  ==  'sc_req_item' && current.sysapproval.opened_by ==  current.approver


Script:

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

	// Add your code here
	
	current.approver = current.approver.manager;
	current.comments = 'Approver is also Requester - Moved to Manager';

})(current, previous);

 

It was modified from a BR that I've used to auto-approved if Requester is also Approver. I haven't tested it.

 

Regards,
Niklas

View solution in original post

10 REPLIES 10

Niklas Peterson
Mega Sage
Mega Sage

Hi,

You can't just prevent them from approving the approval. The you would be stuck with a lot of hanging approvals.
You need to control this in the process of raising the approval and redirect it to someone else.

 

Regards,
Niklas

@Niklas Peterson : Thanks for the reply,

 

Suppose the person making the request is also the approver, which means they cannot approve the request themselves. In such a scenario, how can we implement the functionality to automatically assign the request to their manager?

Hi,

If it is always the manager who should "step in". Then you can have a BR running on the approval records that does the check and move the approval to the manager. Or you modify the workflow/flow that raises the Approval and sends it correctly. 

The advantage of the BR is that you don't need to modify existing workflows.

 

Regards.

Niklas

@Niklas Peterson : Is this an OOB Business rule or Do need to create a new one?