3

I have been using Process Builder for a few weeks now. Its main purpose for me has been in its ability to update records in my database without having to click "edit" and "save". I have certain triggers firing off foreign field values, which are therefore only updating when I enter into their object and click the mentioned buttons. Process builder has enabled me to fix this problem. All has been working swell - that is until just recently.

Currently every time I build a new process, an old one stops working; it does not deactivate, it simply ceases to operate successfully. I understand there are governor limits etc, however I do not fully understand these. From my comprehension, after doing a bit of reading, my APEX coding and Processes are hardly close to these limitations.

I am curious if anybody knows of a solution. These processes are very important to the operations of my database. I would appreciate any sort of help.

To be clear, it is the actions within the processes which stop working. For example, I have a process that updates a custom object upon the change of a field in the opportunity object. This change should update two separate objects - obj1 and obj2. I therefore create two processes and activate them. They are however failing to work simultaneously. When I deactivate one, the other works - vice versa. When I bring the two actions into one process the top-most action is the only one which works.

1

I'm confident that you've likely heard of the phrase "one trigger per object". It sounds as though your processes that fire on Opportunity need to be combined so they can be evaluated and executed at the same time. If you were using work rules instead of process builder, they could execute separately. With process builder, your process should really encapsulate the entire business process for the object, just as ideally, there'd be one trigger that executes all the logic for a single object.

See these two posts Generic Apex Trigger and General trigger bulkification - best practices to help you with triggers.

  • 1
    crmprogdev, thank you for your response. I just compressed the three opportunity processes onto one - it is still not working. I do have three separate triggers on my Opportunity, I had never heard of the "one trigger per object" as I just recently taught myself how to write them. Do you think that by compressing them into one trigger would solve this problem? Or is that just a standard you mentioned that developers should abide by? – Cole Swain Jul 9 '15 at 14:13
  • It's entirely possible that the three triggers are competing with the processes. The fact that you've combined the three processes into one and they now don't work, would seem to indicate that there's some kind of incompatibility with what you're trying to do. It's possible that one of them needs to occur first. I recommend you study the debug logs to look and see what's happening. That should tell you a lot. Yes, ideally, all triggers for an object should be combined to control the logic for order in which they execute and minimize re-entry & re-execution. See links in my edit. – crmprogdev Jul 9 '15 at 14:55
  • PB runs off Flow and they will step on each other if they both try and run at the same time. You should normally get a pretty poorly generated error report from the PB that failed. – Dan Aug 16 '16 at 23:02
  • @Dan The behavior of PB has changed significantly since this question was asked. At that time, PB still wasn't considered reliable in that it wasn't "bulk safe". There could have been any number of things going on with his process. Exactly how he combined the processes is unclear. When combining two processes, one generally needs to think in terms of either branching or else encapsulating a flow. Depending on hierarchies, two separate DML operations on related objects could have been problematic by spawning other processes he didn't consider. – crmprogdev Aug 18 '16 at 14:34

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.