Hi All,
I need to populate Sales Header Location with the Location code on the first Sales Line here I have done this
Hi All,
I need to populate Sales Header Location with the Location code on the first Sales Line here I have done this
Hi,
Did you try below?
[EventSubscriber(ObjectType::Table, Database::"Sales Line", 'OnAfterValidateEvent', 'No.', false, false)]
local procedure OnAfterValidateEvent(var Rec: Record "Sales Line"; CurrFieldNo: Integer; var xRec: Record "Sales Line")
var
SalesHdr: Record "Sales Header";
begin
if SalesHdr.get(rec."Document Type", rec."Document No.") then begin
rec.Validate("Location Code", SalesHdr."Location Code");
rec.Modify();
end;
end;
André Arnaud de Cal...
292,489
Super User 2025 Season 1
Martin Dráb
231,305
Most Valuable Professional
nmaenpaa
101,156