1

We have multiple rules setup for Case using process builder but one of the rule seems to be failing throwing CPU Time Limit Exceeded error. The process is failing at this step where i am updating OwnerID with LastModifiedById since there are a total of 5 million Cases.

enter image description here

enter image description here

enter image description here

I would like to know if there's a way to call a batch class in the immediate action leaving the criteria as-is? How can i query the cases in batch apex that i could call here in the process builder?

Thanks in advance.

3
  • 1
    Where does the 5 million Cases come into play? Are you running a bulk data update across your entire table?
    – David Reed
    Commented Nov 12, 2019 at 3:12
  • @david we have Case Merge Premium appexchange app which our users use to merge duplicates into one case and status for all duplicates will be Duplicate. That's when this criteria is being picked up.
    – SunnyG
    Commented Nov 12, 2019 at 3:19
  • 1
    Process Builders are notorious in being very inefficient in CPU terms. You would probably be better off turning the more complex ones into a mix of trigger and async processing.
    – Phil W
    Commented Nov 12, 2019 at 7:12

1 Answer 1

1

CPU time limit is exceeding due to processing of large number of records with given logic. https://welkinsuite.com/blog/how-to-get-past-apex-cpu-limits/

Apart from this, you can call Batch class from Process builder or Trigger. You can try with Batch from Trigger and run it Async. Using Code you can put your logic to filter out only those records need to be updated.

1
  • While this may theoretically answer the question, it would be preferable to include the essential parts of the answer here, and provide the link for reference.
    – identigral
    Commented Apr 14, 2022 at 18:24

You must log in to answer this question.

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