- No applicable approval process was found.
- This record is currently in an approval process. A record can be in only one approval process at a time.
My understanding is:
The approval record process has already been triggered, so the approval process cannot be found (for point 1) and as the record is already in the approval process error (2) appears.
The approval process worked fine in our fully copy sandbox (where the Apex does not exist) but not in production.
All suggestions welcome
p.s. The approval process is active and exists in production.
1 respuesta
Obviously multiple triggers = bad, but I think you've realized that part haha
Error 1: I'm guessing you have defined entry criteria that once a record enters the approval process is no longer valid. Example: Entry Criteria includes 'Approval Status = Required,' then for Initial Submission actions you have a field update changing the Approval Status to 'Submitted,' the other automation would see that record as no longer meeting the entry criteria.
Error 2: Exactly what you think it is - one of the triggers (ex: process builder can be set to bypass entry criteria) is getting around the entry criteria and submitting the record for approval, receiving this second error.
Sounds like in either case, you need to better define your entry and submission criteria. I typically use an Approval Status field, so that any submitting triggers (PB or otherwise) ignore the record once Approval Status = Submitted. Adding in a quick field like that, where the Approval Process updates it along the way, should prevent these issues moving forward.