13

Could you please improve the error messages in the Purch. Posting Routine.



local procedure PostItemTrackingCheckShipment(PurchaseLine: Record "Purchase Line"; RemQtyToBeInvoiced: Decimal)

var

    IsHandled: Boolean;

begin

    IsHandled := false;

    OnBeforePostItemTrackingCheckShipment(PurchaseLine, RemQtyToBeInvoiced, IsHandled);

    if IsHandled then

        exit;


    if Abs(RemQtyToBeInvoiced) > Abs(PurchaseLine."Return Qty. to Ship") then begin

        if PurchaseLine."Document Type" = PurchaseLine."Document Type"::"Credit Memo" then

            Error(InvoiceGreaterThanReturnShipmentErr, ReturnShptHeader."No.");

        Error(ReturnShipmentLinesDeletedErr);

    end;

end;


local procedure PostItemTrackingCheckReceipt(PurchaseLine: Record "Purchase Line"; RemQtyToBeInvoiced: Decimal)

var

    IsHandled: Boolean;

begin

    IsHandled := false;

    OnBeforePostItemTrackingCheckReceipt(PurchaseLine, RemQtyToBeInvoiced, IsHandled);

    if IsHandled then

        exit;


    if Abs(RemQtyToBeInvoiced) > Abs(PurchaseLine."Qty. to Receive") then begin

        if PurchaseLine."Document Type" = PurchaseLine."Document Type"::Invoice then

            Error(QuantityToInvoiceGreaterErr, PurchRcptHeader."No.");

        Error(ReceiptLinesDeletedErr);

    end;

end;


The two Errors are missing some details:

  • InvoiceGreaterThanReturnShipmentErr
  • QuantityToInvoiceGreaterErr


It would be helpful if you provide some details on the related Purchase Line. (e.g. Type, No. or Document No. & Line No.)

Category: Purchasing
STATUS DETAILS
Needs Votes
Ideas Administrator

Thank you for this suggestion! Currently this is not on our roadmap. We are tracking this idea and if it gathers more votes and comments we will consider it in the future. Best regards, Business Central Team