Hello Experts
in sales Order page there is Field External Document No. if we tried to enter value in page that already added and preseent in sales header table means if this field already have value in table Sales Header it should not allow same value to be entered I am unaware how to achive cah you please help me i tried following code but stuck on validate of Ecternal DOc no. of page
thnaks in Advance Experts
hi
the external document number is not unique, you can associate it with multiple orders
so the solution that Mohana proposes is correct
DAniele
This is done already on Purchase Orders, so You can check the validation of that field, and create the same for Sales Documents.
Make sure that once you posted the Order fully then the Order will be deleted and in that case the system will check External Doc No. in the existing Orders and not the already posted (deleted) orders.
If you want to check all existing and previous orders then use Customer Ledger Entries.
salesH.Reset;
SalesH.Setrange("Document Type", Rec."Document Type);
SalesH.Setfilter("No.",'<>%1',Rec."No.");
SalesH.SetRange("External Document No.", Rec.External Document No.);
if SalesH.findfirst then begin
Error('External Document No. %1 already used in document %2',Rec.External Document No.,SalesH."No.");
Please fix if there are any compilation issues as I just typed the logic here.
Stay up to date on forum activity by subscribing. You can also customize your in-app and email Notification settings across all subscriptions.
André Arnaud de Cal... 291,219 Super User 2024 Season 2
Martin Dráb 230,056 Most Valuable Professional
nmaenpaa 101,156