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

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

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

Execution order of subscriptions for the same event (BaseApp vs PTE)

(0) ShareShare
ReportReport
Posted on by 10

Hi All,

There is one question I seek for your advise :

"If Microsoft baseapp is subscribing to an event, and our app as PTE are also subscribing to that event, will Microsoft BaseApp codes always run first ?"

Real scenario is :
On codeunit 5345 "Integration Rec. Synch. Invoke".There are events OnAfterInsertRecord and OnAfterModifyRecord.
Microsoft baseapp is subscribing to those events in codeunit 5341 "CRM Int. Table. Subscriber".
One of the thing that BaseApp's codes do is when synching 'CRM Salesorder-Sales Header', it will change the status of Sales Order to Release.

The thing is, we need the status to be Open after synchronize
(We will need to do approval in Business Central ).

p.s :
I tested subscribing to that event and set the status to open and it works fine in Sandbox ( Baseapp's codes will run first). Probably due to my app ID is smaller that BaseApp ID.
Baseapp ID  : 437dbf0e-84ff-417a -***
Our app ID   : ea74d4be-8b1f-46ce-***

The thing is that I am not 100% sure that this will always work without failing if I apply to prod.

So, it would be appreciated if you have any reference or experience that can be shared.

I have the same question (0)
  • Verified answer
    Mohana Yadav Profile Picture
    61,184 Super User 2026 Season 1 on at

    AFAIK, there is no guarantee in the order of execution of subscribers.

    But you can refer this

    https://yzhums.com/22715/

  • HHalim Profile Picture
    10 on at

    Hi Mohana,

    Thanks for replying.

    I went through Yzhum blog regarding the extension order before. It was a great help.

    Anyway, the testing is between PTE's.

    I just hope may be there is a more certain documentation somewhere if between Microsoft BaseApp and partner's PTE.

    Thanks

  • Suggested answer
    Inge M. Bruvik Profile Picture
    1,161 Moderator on at

    There is simply no guarantee in what order a event subscriber code will be exceeded.

    So if you need something to happen in the system after every other subscribers code is executed then you need another strategy instead of using an event subscriber.

    Maybe it will be better to use a job that is triggered by a job queue or something that is triggered by power automate. It all depends on your business needs.

  • Verified answer
    YUN ZHU Profile Picture
    98,381 Super User 2026 Season 1 on at

    Hi, I think the BaseApp just defines the Event, and where it is executed. If the standard Event's are called in BaseApp, I think the rules I tested for App ID's are still valid.

    PS: If you are referring to the order of execution in different triggers, you can check Kauffmann's blog.

    https://www.kauffmann.nl/2018/03/24/table-trigger-events-in-dynamics-365-business-central/

    pastedimage1675044891482v1.png

    Hope this helps as well.

    Thanks.

    ZHU

  • HHalim Profile Picture
    10 on at

    Hi Yun zhu,

    Thanks.

    I also agree, I think between BaseApp and Our PTE, regarding the order of execution,  the App ID's rules should still apply.

    I will do more testing, and let you guys know if any update.

    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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

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 1,965 Super User 2026 Season 1

#2
YUN ZHU Profile Picture

YUN ZHU 1,125 Super User 2026 Season 1

#3
Dhiren Nagar Profile Picture

Dhiren Nagar 961 Super User 2026 Season 1

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans