Skip to content

Event Request C229.OnBeforeDoPrintSalesHeader #1237

@jwikman

Description

@jwikman

Please add the event OnBeforeDoPrintSalesHeader, with the "Handled" pattern, to Codeunit 229:

[Integration]
LOCAL PROCEDURE OnBeforeDoPrintSalesHeader@12044959(VAR SalesHeader@12044959 : Record 36;ReportUsage@12044960 : Integer;SendAsEmail@12044958 : Boolean;VAR IsHandled@12044961 : Boolean);

The parameter SalesHeader needs to be VAR, since we need the filters
The parameter IsHandled needs to be VAR, since it's set to TRUE by subscriber if the function is handled

Call the event OnBeforeDoPrintSalesHeader from DoPrintSalesHeader:

LOCAL PROCEDURE DoPrintSalesHeader@14(SalesHeader@1000 : Record 36;SendAsEmail@1002 : Boolean);
VAR
  ReportSelections@1001 : Record 77;
  IsHandled@12044959 : Boolean;
BEGIN
  SalesHeader.SETRANGE("No.",SalesHeader."No.");
  CalcSalesDisc(SalesHeader);
  OnBeforeDoPrintSalesHeader(SalesHeader,GetSalesDocTypeUsage(SalesHeader),SendAsEmail,IsHandled);
  IF IsHandled THEN
    EXIT;
  IF SendAsEmail THEN
    ReportSelections.SendEmailToCust(
      GetSalesDocTypeUsage(SalesHeader),SalesHeader,SalesHeader."No.",SalesHeader.GetDocTypeTxt,TRUE,SalesHeader.GetBillToNo)
  ELSE
    ReportSelections.Print(GetSalesDocTypeUsage(SalesHeader),SalesHeader,SalesHeader."Bill-to Customer No.");
END;

image

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions