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

Announcements

News and Announcements icon
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!!








I have the same question (0)
  • Suggested answer
    IB-29041624-0 Profile Picture
    1,191 Moderator on at

    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.

  • Suggested answer
    Nitin Verma Profile Picture
    21,812 Moderator on at

    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
    YUN ZHU Profile Picture
    102,079 Super User 2026 Season 1 on at

    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

  • JesusCruz Profile Picture
    20 on at

    Hi Inge,

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

    Thanks for your help!!

  • JesusCruz Profile Picture
    20 on at

    Thanks everyone  for your commennst ans suggestions!!

    Merry Christmas!!!

  • Suggested answer
    IB-29041624-0 Profile Picture
    1,191 Moderator on at
    [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.

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

Season of Sharing Community Challenge Launch!

Jump in, show your community spirit, and win prizes!

Women in Power Builds Momentum

Expanding mentorship, skilling, and AI innovation

Congratulations to the May Top 10 Community Leaders

These are the community rock stars!

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

#1
OussamaSabbouh Profile Picture

OussamaSabbouh 1,713 Super User 2026 Season 1

#2
YUN ZHU Profile Picture

YUN ZHU 1,032 Super User 2026 Season 1

#3
Grigorios Mavrogeorgis Profile Picture

Grigorios Mavrogeorgis 914 Super User 2026 Season 1

Last 30 days Overall leaderboard

Featured topics

Microsoft Training Manuals

Product updates

Dynamics 365 release plans