Any help is greatly appreciated. I have a record that is already submitted for approval and I need a "validation type check" to kick off to verify a "Duplicate" checkbox is not checked before the final approver approves the record. I need this validation to be done while the record is in the hands of the final approver and not the initial submitter.
I was originally thinking of using Component Visibility but I have a message that says this can't be done on the Approval Request Lightning Page.
I'd rather do this without code but if code is the only option I'll go with it. I'm only seeing solutions with a Before Save Trigger but if there's another way please let me know. Thanks! #Trailhead Community #Automation #Data Management
I ended up using a Flow. It's not exactly what I wanted but it works. Essentially the user clicks final approval and if a certain field is not correct then it pushes it back into an approval process. I'll include the steps in case it provides help to anyone else.
1. Final approval is clicked and a field update takes place to mark a "Create Invoice" checkbox True.
2. After Save Flow kicks off when the "Create Invoice" checkbox is checked.
3. Decision Element checks if a "Duplicate" checkbox is checked. If not, create the invoice and line items but if this is marked as a duplicate then step 4 kicks off.
4. Since this is a duplicate we use an Update Element to uncheck the "Create Invoice" checkbox to prevent the invoice being created.
5. Action Element "Submit for Approval" uses the Record Id of {!$Record.Id} & the Approval Process Name Or ID is the unique name of a second approval process. If you use the same approval process that kicked off originally then you get an error saying something like "Error Occurred: This record is currently in an approval process. A record can be in only one approval process at a time."