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

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,005 Super User 2025 Season 2 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,111 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
    95,748 Super User 2025 Season 2 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

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 2,066

#2
YUN ZHU Profile Picture

YUN ZHU 658 Super User 2025 Season 2

#3
Sumit Singh Profile Picture

Sumit Singh 595

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans