Skip to main content
Community site session details

Community site session details

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

Problem with extensions ejecution

(0) ShareShare
ReportReport
Posted on by 20
Hello Everybody,

We have experienced problems with the execution of customizations, this behavior began to appear with the version 21.1 update and increased in the last days after the 21.2 update It would seem that some functions ( Declared in events ) are not executed and the processes are incomplete and generate problems. Yesterday we loaded the extension where the customizations are and the processes worked correctly, but today the problem reappeared.

We have 3 functions in events

[EventSubscriber(ObjectType::Codeunit, Codeunit::"Sales-Post", 'OnAfterPostSalesDoc', '', true, true)]
procedure F1
....

[EventSubscriber(ObjectType::Codeunit, Codeunit::"Sales-Post", 'OnAfterPostSalesDoc', '', true, true)]
procedure F2
....
 
[EventSubscriber(ObjectType::Codeunit, Codeunit::"Sales-Post", 'OnAfterPostSalesDoc', '', true, true)]
procedure F3
....


We espect

F1 fisrt execution
F2 second execution
F3 Third execution.

F3 needs F2 Execution and F1 execution.

It appears F1 does not execute and error appears when f3 is executing.

We debug somwetimes in sandbox with no problem ( F1 First, f2 second and f3 third was executing)


Any similar problem?
We appreciate any help!!


Thanks in advance!!








  • Suggested answer
    Inge M. Bruvik Profile Picture
    1,029 Moderator on at
    RE: Problem with extensions ejecution
    [quote user="JesusCruz"]

    Hi Inge,

    We re-write the code into one event suscriber , now all it's fine !

    Thanks for your help!!

    [/quote]

    You are welcome. I am happy to hear that you got it to work.

  • JesusCruz Profile Picture
    20 on at
    RE: Problem with extensions ejecution

    Thanks everyone  for your commennst ans suggestions!!

    Merry Christmas!!!

  • JesusCruz Profile Picture
    20 on at
    RE: Problem with extensions ejecution

    Hi Inge,

    We re-write the code into one event suscriber , now all it's fine !

    Thanks for your help!!

  • Suggested answer
    YUN ZHU Profile Picture
    86,057 Super User 2025 Season 1 on at
    RE: Problem with extensions ejecution

    Inge is absolutely right.

    If your functions are not in the same App, please refer to the following test.

    Execution order of subscriptions for the same event in different extensions (apps)

    https://yzhums.com/22715/

    Hope this helps as well.

    Thanks

    ZHU

  • Suggested answer
    Nitin Verma Profile Picture
    21,571 Moderator on at
    RE: Problem with extensions ejecution

    Hi,

    NorthW  is right here, you should consider always one event of each object in single codeunit. Please try to club all your modifications into one single event.

  • Suggested answer
    Inge M. Bruvik Profile Picture
    1,029 Moderator on at
    RE: Problem with extensions ejecution

    If you have 3 functions that you have to relay on being executed in a specific order then you should write that code in one event subscriber.

    Because if you have more that one event subscriber you have no control over the sequence they are executed in.

    So your code is not structured according to best practice.

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

News and Announcements

Now Available: 2025 Release Wave 2

Quick Links

Ramesh Kumar – Community Spotlight

We are honored to recognize Ramesh Kumar as our July 2025 Community…

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

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

#1
Sohail Ahmed Profile Picture

Sohail Ahmed 2,655

#2
Mansi Soni Profile Picture

Mansi Soni 1,574

#3
YUN ZHU Profile Picture

YUN ZHU 1,453 Super User 2025 Season 1

Featured topics

Product updates

Dynamics 365 release plans