0

I have an approval process defined the scenarios I need to cover are:

  1. Users after save a record (in a custom object), I have a apex class that sends the record to approve, (the process is going to the approval process.), the approver gets an email with the request to approve so he can approve or reject as normal the process is). This scenario works fine.

  2. In some cases an specific user (admin) make a mass upload with around 100 record, the apex class handle to send all of them to approve and then those are by default approved by default.

The problem with the scenario 2 is, when the record is sent to approve by Apex, the default approver is getting a lot of emails with the (The request XXXX requires approval).

Is there a way to avoid to send the initial submission email when from apex I see the size of the records is greater than 1 record for example? If not, what would be a workaround for this situation?

2 Answers 2

1

You can temporarily disable automated emails generated form Salesforce by going to Setup > Adminster > Email Administration > Deliverability and changing the Access Level to No Access.

Another option is to go to the User profile for the default approver and change the "Receive Approval Request Emails" to "never" during the upload. Check out this knowledge article for more info: https://help.salesforce.com/articleView?id=000004507&type=1

0

One workaround is for your 2nd case, Create a mass load indicator boolean field on that object.

When you are uploading the data either through excel, make it true.

create a separate approval process which will look for approval criteria based this field value as true.

Since, by default these records are automatically approved, so create dummy user and put invalid email id (like, [email protected]) and make this user as an approver.

Invalid email id will not receive any emails from Salesforce.

Hope, it makes sense!

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .