Please advise, I'm writing custom logic like: 'User cannot close an Opp if it has no OppContactRoles'

Does anyone know if there is an action in Process Builder to stop a record from updating? Preferably with an alert similar to apex .adderror() method.

I cannot use a custom Validation rule on my Opp because the logic depends on OppContactRoles (which allow no triggers and no standard Rollup to Opp) so I plan to rollup(count) oppContactRoles using a PB. Problem is- validation rules run before a PB. Also I like to keep logic in one place, so saving writing a 'Before' trigger as a last resort. Thanks!

  • 1
    I think the only way you can do this currently is to write some Invocable Apex and throw an .addError() based on the conditions you are looking for – Bryan Anderson Nov 18 '19 at 15:20

I found an old explanation: https://developer.salesforce.com/forums/?id=906F00000005FUoIAM Apparently this one does not have a solution, as it is not possible to invoke Apex .addError() from inside a process builder. Being too deep in the dream within a dream.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.