Importing TextData with DataPort to Create Invoicing for Purchase Orders

Looks like only way to create an invoice or receiving for a purchase order in NAV is to open the po and modify the qty toinvoice or Qty to Receive fields and then to POST the transaction.

I would like to import invoicing records related to purchase orders from a CSV file using XMLPORT in nav2013.

I already wrote one that imports and creates new Purchase Invoices with header & line data but that does not involve PO numbers.

How would this process work?

  1. I am using [Purchaser Header] & [Purchase Lines] tables for this new import , Is this correct?
  2. I cant find a POnumber field in Purchase Header or Lines tables. System is setup to create PO numbers automatically (no manual login) so if I populate Purchase Header.No. field I get error.
  3. Is the process different than creating new Purchasing Invoices using the OnBeforeInsertRecord and using .INSERT(TRUE) ?
  4. I tried using OnBeforeUpdate() and using MODIFY(TRUE) but couldnt get it towork.
  • Tried to use Purchase Lines.GET(PONUMBER) then assigning quantityToInvoice value and to set MODIFY(TRUE) but that didnt work either?

How would I go around doing this?