-
Notifications
You must be signed in to change notification settings - Fork 685
Description
Why do you need this change?
Hello,
I need an event at the beginning of the Post procedure. I am currently migrating from NAV to Business Central, and previously the code was as follows:
LOCAL PROCEDURE Post@2(PrintRegister@1000 : Boolean);
VAR
ReversalPost@1001 : Codeunit 179;
GLBookEntry@1130000 : Record 12144;
BEGIN
//TD241210
SETFILTER("Posting Date",'<>%1',"Posting Date");
IF FINDFIRST THEN BEGIN
ErrPostingDate := STRSUBSTNO(Text002, "Posting Date");
ERROR(ErrPostingDate);
END;
//TD241210
IF GLBookEntry.GET("Entry No.") THEN
GLBookEntry.TESTFIELD("Progressive No.",0);
ReversalPost.SetPrint(PrintRegister);
ReversalPost.RUN(Rec);
CurrPage.UPDATE(FALSE);
CurrPage.CLOSE;
END;
Describe the request
Therefore, I would need an event at this point to be able to handle the error as it was done previously. The new code could look like this:
procedure Post(PrintRegister: Boolean)
var
ReversalPost: Codeunit "Reversal-Post";
begin
OnBeforePost(Rec);
ReversalPost.SetPrint(PrintRegister);
ReversalPost.Run(Rec);
CurrPage.Update(false);
CurrPage.Close();
end;
[IntegrationEvent(false, false)]
local procedure OnBeforePost(var Rec: Record "Reversal Entry" temporary)
begin
end;
Internal work item: AB#611655