Skip to content

[Event Request] Page 183 "Reverse Transaction Entries" #29349

@LorenzoSartori-NBT

Description

@LorenzoSartori-NBT

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    FinanceGitHub request for Finance areaevent-requestRequest for adding an event

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions