0

I am using process builder to invoke the auto-launched flow whenever there is an change in the 'Status' field. This process builder and flow is working good for 2 or 3 records. But when I tried to create a 10 or 15 records to test the flow, its not working properly. As I tested, the process is correctly invoked the auto-launched flow, but the flow is not working.
enter image description here

Could you please point what I have done wrong?

5
  • , welcome to SFSE! Please take a moment to visit the help center, scroll through the tour, and read How to Ask. What have you debugged and what exactly does it mean when you say "it's not working" - what do you expect to happen and what is not happening. You can edit your question to provide more specifics Commented Dec 23, 2021 at 13:13
  • You are doing a Get Records element within a loop which can lead to limits violations
    – cropredy
    Commented Dec 23, 2021 at 19:08
  • @cropredy I tried to remove the flow and using invocable apex to avoid SOQL in loop, but still its not working Commented Dec 27, 2021 at 12:38
  • What does the debug log tell you?
    – cropredy
    Commented Dec 27, 2021 at 15:33
  • Hi @cropredy, I have added one pause element in the starting of the flow. Because, when I checked the debug log, the changes are not committed in the DB for multiple records. After adding this pause, the changes are committed to DB and the conditions are working fine. Thanks for the reply. Commented Dec 28, 2021 at 12:47

1 Answer 1

0

After so many debug log and analysing I found some solution which is working good for me. In my scenario, when checking for 1 or 2 records changes, its working. But when I checked for more than 10 records the flow is not working properly. By checking the debug log, the recent changes are not committed in the DB. For this purpose, I just added the pause element at the beginning of the flow to commit all the changes to DB. For resume event, I have given 2 seconds and I have added no conditions for pause.

enter image description here

enter image description here

enter image description here

3
  • 1
    using a Pause element starts a new transaction and resets limits. While this solution may get around your current issue; you may have some lurking, underlying inefficient trigger or automation.
    – cropredy
    Commented Dec 29, 2021 at 19:55
  • @cropredy, how do I find this kind of thing in my code? Do I have any other solution to commit the changes at the end of the flow? Because, in my scenario one flow invokes another like wise doing some kind of work. If the there is some error happened in the 5th flow, all the 4 flows are rolled back. I don't want to happen like this. Is it there any solution for this? Commented Dec 30, 2021 at 12:26
  • You are asking a wider question here and should pose it as a separate question on this site.
    – cropredy
    Commented Dec 30, 2021 at 15:24

You must log in to answer this question.

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