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

Notifications

Announcements

No record found.

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
    Inge M. Bruvik Profile Picture
    1,111 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,708 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
    95,548 Super User 2025 Season 2 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
    Inge M. Bruvik Profile Picture
    1,111 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

Responsible AI policies

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

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

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

#1
OussamaSabbouh Profile Picture

OussamaSabbouh 3,151

#2
Jainam M. Kothari Profile Picture

Jainam M. Kothari 1,443 Super User 2025 Season 2

#3
YUN ZHU Profile Picture

YUN ZHU 1,092 Super User 2025 Season 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans