web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Small and medium business | Business Central, N...
Suggested Answer

EventSubscriber Modifies a Record when OnBeforeModify - how do I prevent recursion?

(0) ShareShare
ReportReport
Posted on by
I have a fairly simple eventsubscriber that watches the Job table, and onBeforeModify updates a field. The problem is, when this field is updated, the eventsubscriber enters a state of recursion. I recollect there was a way / flag to prevent this, but am not seeing anything.
 
Any suggestions?
I have the same question (0)
  • Ram Pranav Profile Picture
    50 on at
    Hi,
     
    I don't think there is a flag to stop recursion. BC usually throws an error on runtime if the code is recursive. You might want to double check your code for any accidental recursion.
     
    Regards,
    Ram Pranav.
  • Suggested answer
    YUN ZHU Profile Picture
    97,089 Super User 2025 Season 2 on at
    Hi, I agree with Ram, this should be the trigger of OnModify executed elsewhere, you can try to debug it step by step.
     
    Hope this helps.
    Thanks.
    ZHU
  • Suggested answer
    Nitin Verma Profile Picture
    21,744 Moderator on at
    Hi,
    You need to debug your application why is repeating that code again and again.
     
    Thanks.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Congratulations to our 2025 Community Spotlights

Thanks to all of our 2025 Community Spotlight stars!

Leaderboard > Small and medium business | Business Central, NAV, RMS

#1
OussamaSabbouh Profile Picture

OussamaSabbouh 2,072

#2
Dhiren Nagar Profile Picture

Dhiren Nagar 1,234

#3
YUN ZHU Profile Picture

YUN ZHU 1,029 Super User 2025 Season 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans