at4dx icon indicating copy to clipboard operation
at4dx copied to clipboard

DomainProcessBinding__mdt.PreventRecursive__c is ignored.

Open simon-nowak opened this issue 11 months ago • 1 comments

Describe the bug During trigger execution, criteria/action can be executed several time whatever the value set in DomainProcessBinding__mdt.PreventRecursive__c

As a result this can lead to additional limits consumption.

To Reproduce

I think I managed to reproduce the issue in my repo with a unit test: https://github.com/apex-enterprise-patterns/at4dx/compare/master...simon-nowak:at4dx:preventRecursive

Expected behavior I think any developper would like to be able to prevent recursive execution during a transaction. Projects like DLRS or flows can lead to recursive execution.

Version Present in last version

I might have a few spare days this week and next week. If this is a feature that need to be implemented inside the framework, I would like to try to fix it.

I'm not 100% sure how this should work:

  • Can "prevent recursive" be applied for to criteria AND actions ?
  • If "prevent recursive" is applied what is the expected behaviour? Should it filter by "records" already evaluated, or be less precise and only focus on being called once?

simon-nowak avatar Sep 19 '23 16:09 simon-nowak