We have a lot of old purchase orders that we need to invoice. They have all been received in. Each time you go and invoice the PO it requires a Vendor Invoice No.. I am trying to create a report that we can run and have it add the vendor invoice no into each PO and auto increment the no. I was able to get it to add a vendor invoice no but can't get to increment the number for each new PO that we need to invoice. Is there a way to do this? I have set an integer (VendInvNo)
VendInvNo := 10000;
IF ("Vendor Invoice No." = '') THEN BEGIN
PurchHdr.RESET;
PurchHdr.SETRANGE("No.","Vendor Invoice No.");
IF PurchHdr.FINDFIRST THEN BEGIN
"Vendor Invoice No." := PurchHdr."Vendor Invoice No.";
VendInvNo := VendInvNo + 1;
MODIFY;
END;
END;
Thank you in advance.
0
Answers
If you don't care about the real vendor invoice numbers just untick Ext. Doc. No Mandatory in Purchase & Payables Setup, and don't put anyting in it.
Slawek
Dynamics NAV, MS SQL Server, Wherescape RED;
PRINCE2 Practitioner - License GR657010572SG
GDPR Certified Data Protection Officer - PECB License DPCDPO1025070-2018-03