By now Im pretty clear about Recorder Event, and because of that I thought that getting some values in the OnAfterPost will get me to the right moment when data has been commited to database and from there I could consult data with some confidence, what I need to do now, is after a pick warehouse as been posted, I need to consult registered pick number as I need to give that number to a secondary appl, but, Im still unable to catch that specific moment where OnAfterPost is really finished,
So for my first option I used RegisterPick's Event from Page's Object Warehouse Pick, didnt work, then I used what you suggested, but didn't work either.
When my pick warehouse is totally posted, and just after that, is when I need to consult its ID so I can save it, and that is all.
TIA for your great help and patience.
If you are working with processes that do some kind of posting you generally want to look at events that starts with OnAfterPost......... because they are triggered after the posting is completed and transactions are committed in the database.
And in the OnAfterPost........ triggers raising and error will not roll back the posting.
There is also a tool in Business Central called the event recorder that you can run for a whole process or a part of a process and that will show you what events are triggered and in what order. The tool might be a bit overwhelming in the beginning but is some scenarios it is very useful.
You can read some more about it here and there are also a lot of technical blog posts avalible around this.
When do you know a task is really finished, because when my routine is suscribed to this Event, and I try to recover information for lines, they doesn't exist either in picking lines nor picking registered lines, so I'm little confused about timing. I have tried to suscribe to
[EventSubscriber(ObjectType::Codeunit, Codeunit::"Whse.-Activity-Register", 'OnAfterRegisterWhseActivityLines', '', true, true)]
local procedure "Whse.-Activity-Register_OnAfterRegisterWhseActivityLines"
(var WarehouseActivityLine: Record "Warehouse Activity Line")
but then I can't see header values... :|
How can I identify when a transaction or a whole process has been finished completly?
I'm a little bit confused and lost :(
TIA
Hi,
I think you should have a look at this integration event instead of the on you have tried using.
[EventSubscriber(ObjectType::Codeunit, Codeunit::"Whse.-Activity-Post", 'OnAfterPostedInvtPickHeaderInsert', '', false, false)]
local procedure OnAfterPostedInvtPickHeaderInsert(var PostedInvtPickHeader: Record "Posted Invt. Pick Header"; WarehouseActivityHeader: Record "Warehouse Activity Header");
begin
end;
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,280 Super User 2024 Season 2
Martin Dráb 230,214 Most Valuable Professional
nmaenpaa 101,156