17

Hello Microsoft,


Could we please have an eventsubscription/hookpoint for:

Where: Before EmptyLineFound true/false check

Function: CheckSalesLines

Object type: Codeunit

Object id: 13629

Object name: "OIOUBL-Check Sales Header"

App: OIOUBL

Publisher: Microsoft


Example:

User need to Post 3 sales order where customer has OIOUBL as "Document Sending Profile".

After user has trigget action "Post and Send Document" and after clicked yes in next window, it will give a pop-up message where user need to confirm:


"The Sales Order XXX contains lines in which either the Type, the No. or the Description is empty. Such lines will not be taken into account when creating an OIOUBL document.\Do you want to continue?"


The same message will appear for each sales order. Totally 3 times.


Could we have a hookpoint where the "bold" text is:


  local procedure CheckSalesLines(SalesHeader: Record "Sales Header");

  var

    SalesLine: Record "Sales Line";

    EmptyLineFound: Boolean;

    TotalLineAmount: Decimal;

    TotalLineDiscountAmount: Decimal;

  begin

    EmptyLineFound := FALSE;

    TotalLineAmount := 0;

    TotalLineDiscountAmount := 0;

    WITH SalesLine do begin

      RESET();

      SETRANGE("Document Type", SalesHeader."Document Type");

      SETRANGE("Document No.", SalesHeader."No.");

      if FINDSET() then

        repeat

          if (Type <> Type::" ") AND ("No." <> '') AND ("Unit of Measure" = '') then

            ERROR(EmptyUnitOfMeasureErr, "Document Type", "Document No.");

          if Description = '' then

            if (Type <> Type::" ") AND ("No." <> '') then

              ERROR(EmptyDescriptionErr, "Document Type", "Document No.");

          TotalLineAmount += "Line Amount";

          TotalLineDiscountAmount += "Line Discount Amount";

          if (Type = Type::" ") OR ("No." = '')

          then

            EmptyLineFound := TRUE;

          if "Line Discount %" < 0 then

            FIELDERROR("Line Discount %", ValueNegativeErr);

        until (NEXT() = 0);

      if TotalLineAmount < 0 then

        ERROR(AmountNegativeErr);

      if TotalLineDiscountAmount < 0 then

        ERROR(DiscountAmountNegativeErr);


//Hook point here <----

      if EmptyLineFound then

        if NOT CONFIRM(EmptyFieldsQst, TRUE, "Document Type", "Document No.") then

          ERROR(WarningExistErr);

    end;

  end;


Thanks i advance.


Category: Development
STATUS DETAILS
New