sfdc-trigger-framework
sfdc-trigger-framework copied to clipboard
getLoopCount() ?
Is it by design, or just an oversight that there doesn't appear to be a way of seeing how many loops/recursions you are current in?
Would be useful to say "only run this on the outer most loop" etc.
Or have I missed the mark here?
You seem to be correct in this observation. The easiest way I can see to check the loop count is by accessing the loopCountMap
static variable (which is private now).
If it were public, you could get the count using:
TriggerHandler.loopCountMap.get('handlerName').getCount();
If you want to, you might want to submit this as a new feature. If not, I might add this feature to my fork of the repository later.
I don’t see why this couldn’t be added. Happy to look at a PR On Mon, Nov 5, 2018 at 10:56 AM Renato Oliveira [email protected] wrote:
You seem to be correct in this observation. The easiest way I can see to check the loop count is by accessing the loopCountMap static variable (which is private now).
If it were public, you could get the count using:
TriggerHandler.loopCountMap.get('handlerName').getCount();
If you want to, you might want to submit this as a new feature. If not, I might add this feature to my fork of the repository later.
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/kevinohara80/sfdc-trigger-framework/issues/16#issuecomment-435927058, or mute the thread https://github.com/notifications/unsubscribe-auth/AAigQGxx5dGIupMy9w1RKFqkUXlChJUAks5usF-ZgaJpZM4YOm8u .
@kevinohara80 Please take a look at PR #13, thanks.