6

I tried to make a dml call on an empty list in an autolaunched flow and after looking into the debugs, I got to know that governor limits are getting consumed. But the same is not true when we perform the dml on empty lists in Apex. Any ideas ?

HG_
  • 125
  • 1
  • 1
  • 8
  • 3
    Sounds like a bug? I'd suggest logging a case with Support, if you can. – sfdcfox Mar 18 '22 at 18:30
  • Was it for a create element? In testing, it seems that the create element is the only one that doesn't seem to do a no-op (ignoring the fact that delete element has a known issue, it's mentioned it's supposed to be a no-op). – Kris Goncalves Mar 25 '22 at 22:14

1 Answers1

-3

Yes, Performing DML on empty list in a flow consumes governor limits but doing same in apex does not consumes governor limits.

Flows, It is important to note that even though it does not create any records, it consumes from DML statement governor limits. Because this limit is about statements and not the successful operations. Consequently, it might be the best practice to add a Decision element before performing this DML operation.

For more information about the DML execution on flows refer the Link

Reason to skip empty DML in apex, refer the Link

Ankaiah Bandi
  • 1,392
  • 1
  • 4
  • 6