Skip to content

[Event Request] Codeunit 181 "Copy Gen. Journal Mgt." - procedure CheckIfCanBeCopied() #29079

@APsVallelonga

Description

@APsVallelonga

Why do you need this change?

Hello,
We would like to request a new event in the CheckIfCanBeCopied procedure of Codeunit 181 "Copy Gen. Journal Mgt."
This would allow us to bypass the standard checks and implement our own custom logic.

New Event and Code:

local procedure CheckIfCanBeCopied(var PostedGenJournalLine: Record "Posted Gen. Journal Line")
  var
      GLRegister: Record "G/L Register";
     // New Variable
     IsHandled: Boolean;
  begin
      if PostedGenJournalLine.FindSet() then
          repeat
         IsHandled := false;
       //New Event
       OnBeforeCheckIfCanBeCopied(PostedGenJournalLine,IsHandled);
       //New Code
           if not IsHandled then begin 
              GLRegister.Get(PostedGenJournalLine."G/L Register No.");
              CheckCustomerEntries(GLRegister);
              CheckVendorEntries(GLRegister);
          end;
          until PostedGenJournalLine.Next() = 0;

      OnAfterCheckIfCanBeCopied(PostedGenJournalLine);
  end;

Signature:

 [IntegrationEvent(false, false)]
  local procedure OnBeforeCheckIfCanBeCopied(var PostedGenJournalLine: Record "Posted Gen. Journal Line"; var IsHandled: Boolean)
  begin
  end;

Thank You,
Luca

Describe the request

The event would enable us to bypass the checks on the GLRegister fields in the CheckIfCanBeCopied procedure.
Internal work item: AB#598044

Metadata

Metadata

Assignees

No one assigned

    Labels

    FinanceGitHub request for Finance areaevent-requestRequest for adding an eventships-in-future-updateFix ships in a future update

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions