field(5794; "Planned Receipt Date"; Date)
{
AccessByPermission = TableData "Order Promising Line" = R;
Caption = 'Planned Receipt Date';
trigger OnValidate()
var
CustomCalendarChange: array[2] of Record "Customized Calendar Change";
IsHandled: Boolean;
begin
IsHandled := false;
OnBeforeValidatePlannedReceiptDate(Rec, xRec, CurrFieldNo, TrackingBlocked, IsHandled);
if IsHandled then
exit;
if "Promised Receipt Date" <> 0D then begin
if "Planned Receipt Date" <> 0D then begin
CustomCalendarChange[1].SetSource(CalChange."Source Type"::Location, "Location Code", '', '');
"Expected Receipt Date" :=
CalendarMgmt.CalcDateBOC(InternalLeadTimeDays("Planned Receipt Date"), "Planned Receipt Date", CustomCalendarChange, false)
end else
"Expected Receipt Date" := "Planned Receipt Date";
end else
if "Planned Receipt Date" <> 0D then begin
CustomCalendarChange[1].SetSource(CalChange."Source Type"::Vendor, "Buy-from Vendor No.", '', '');
CustomCalendarChange[2].SetSource(CalChange."Source Type"::Location, "Location Code", '', '');
UpdateOrderDateFromPlannedReceiptDate(CustomCalendarChange);
CustomCalendarChange[1].SetSource(CalChange."Source Type"::Location, "Location Code", '', '');
"Expected Receipt Date" :=
CalendarMgmt.CalcDateBOC(InternalLeadTimeDays("Planned Receipt Date"), "Planned Receipt Date", CustomCalendarChange, false)
end else
if "Requested Receipt Date" <> 0D then
Validate("Requested Receipt Date")
else
GetUpdateBasicDates();
NEW EVENT >>
IsHandled := false;
OnValidatePlannedReceiptDateBeforePurchLineCheck(Rec, xRec, IsHandled);
if not IsHandled then
NEW EVENT <<
if not TrackingBlocked then
CheckDateConflict.PurchLineCheck(Rec, CurrFieldNo <> 0);
end;
}
NEW EVENT >>
[IntegrationEvent(false, false)]
local procedure OnValidatePlannedReceiptDateBeforePurchLineCheck(var PurchaseLine: Record "Purchase Line"; xPurchaseLine: Record "Purchase Line"; var IsHandled: Boolean)
begin
end;
NEW EVENT >>
Why do you need this change?
We need this event for implementing of customer funkcionality
Describe the request