You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We've created specific item / inventory sales lines in our add-on which should be excluded from Order Promising calculation.
Therefore, we would like to have an event to filter out sales lines, preferably by adding a filter, alternatively by allowing to bypass the AvailabilityManagement.InsertPromisingLine.
Ideally, we would like to apply a filter using an event which has var access to the SalesLine record.
OnSetSalesHeaderOnBeforeSalesLineFindSet(SalesLine); // var
procedure SetSalesHeader(var OrderPromisingLine: Record "Order Promising Line"; var SalesHeader: Record "Sales Header"; var CaptionText: Text)
var
SalesLine: Record "Sales Line";
SalesAvailabilityMgt: Codeunit "Sales Availability Mgt.";
begin
CaptionText := SalesOrderTxt;
OrderPromisingLine.DeleteAll();
SalesLine.SetRange("Document Type", SalesHeader."Document Type");
SalesLine.SetRange("Document No.", SalesHeader."No.");
SalesLine.SetRange(Type, SalesLine.Type::Item);
SalesLine.SetFilter("Outstanding Quantity", '>0');
OnSetSalesHeaderOnBeforeSalesLineFindSet(SalesLine); // Add New event here
if SalesLine.FindSet() then
repeat
if SalesLine.IsInventoriableItem() then begin
OrderPromisingLine.Init();
OrderPromisingLine."Entry No." := OrderPromisingLine.GetLastEntryNo() + 10000;
SalesAvailabilityMgt.TransferToOrderPromisingLine(OrderPromisingLine, SalesLine);
SalesLine.CalcFields("Reserved Qty. (Base)");
AvailabilityManagement.InsertPromisingLine(
OrderPromisingLine, SalesLine."Outstanding Qty. (Base)" - SalesLine."Reserved Qty. (Base)");
end;
until SalesLine.Next() = 0;
end;
PS: Also provide similar solution for Job Planning and Service lines to be consistent.
Additional context
x
The text was updated successfully, but these errors were encountered:
Describe the request
We've created specific item / inventory sales lines in our add-on which should be excluded from Order Promising calculation.
Therefore, we would like to have an event to filter out sales lines, preferably by adding a filter, alternatively by allowing to bypass the AvailabilityManagement.InsertPromisingLine.
Ideally, we would like to apply a filter using an event which has var access to the SalesLine record.
OnSetSalesHeaderOnBeforeSalesLineFindSet(SalesLine); // var
PS: Also provide similar solution for Job Planning and Service lines to be consistent.
Additional context
x
The text was updated successfully, but these errors were encountered: