[Event Request] Codeunit 99000845 Reservation Management - OnAfterSetReservSource
Somewhat similar to what was mentioned in #8370, it is currently not possible to fully use reservation management for extension tables.
- Subscribing to OnSetReservSource() does not allow calling local UpdateReservation()
- Calling SetExternalDocumentResEntry() instead looks fine at first sight, but processing then fails later on because several global variables (e.g. SourceRecRef, Positive) are not set.
Please add a new publisher OnAfterSetReservSource() and call it at the very end of function SetReservSource() like this:
procedure SetReservSource(NewSourceRecRef: RecordRef; Direction: Enum "Transfer Direction")
var
RunUpdateReservation: Boolean;
EntryIsPositive: Boolean;
begin
[...]
OnAfterSetReservSource(SourceRecRef, CalcReservEntry, Direction, RunUpdateReservation, EntryIsPositive);
if RunUpdateReservation then
UpdateReservation(EntryIsPositive);
end;
The new publisher:
[IntegrationEvent(false, false)]
local procedure OnAfterSetReservSource(SourceRecRef: RecordRef; var ReservEntry: Record "Reservation Entry"; Direction: Enum "Transfer Direction"; var RunUpdateReservation: Boolean; var EntryIsPositive: Boolean)
begin
end;
I will add an OnAfter event for this issue, if you need to run UpdateGlobal for some reason you should instead request for it to be global and then run it wherever you need in your code, not ask for event with new code
Thanks for reporting this. We agree, and we’ll publish a fix asap, either in an update for the current version or in the next major release. Please do not reply to this, as we do not monitor closed issues. If you have follow-up questions or requests, please create a new issue where you reference this one.
I will add an OnAfter event for this issue, if you need to run UpdateGlobal for some reason you should instead request for it to be global and then run it wherever you need in your code, not ask for event with new code
Ok, even better. I will create another issue with this idea.