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.
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
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/
Hope this helps as well.
Thanks.
ZHU
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.
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
AFAIK, there is no guarantee in the order of execution of subscribers.
But you can refer this
Stay up to date on forum activity by subscribing. You can also customize your in-app and email Notification settings across all subscriptions.
André Arnaud de Cal... 291,228 Super User 2024 Season 2
Martin Dráb 230,056 Most Valuable Professional
nmaenpaa 101,156