Dataport Import Purchase Invoice

marcoldemarcolde Member Posts: 12
Hi,

i have create a dataport to import Purchase Invoice .

i start and think it should be work but i does not happens anything.

i insert the code in the onbeforeimportrecord and nav do not create a new invoice and dont insert the vendornumber.

what i have do wrong that i does not work.

thanks for helping
CLEAR(PurchHeader);

PurchHeader."No." := '';
PurchHeader.INIT;
PurchHeader."Document Type" := PurchHeader."Document Type" :: Invoice;
PurchHeader.VALIDATE("Buy-from Vendor No.",VEN);

PurchHeader.INSERT(TRUE);

Answers

  • marcoldemarcolde Member Posts: 12
    i find the solution.

    here is the correct code
    CLEAR(PurchHeader);
    PurchHeader.INIT;
    PurchHeader."Document Type" := PurchHeader."Document Type" :: Invoice;
    PurchHeader.INSERT(TRUE);
    PurchHeader.VALIDATE("Buy-from Vendor No.",VEN);
    PurchHeader.VALIDATE("Posting Date",pdate);
    PurchHeader.VALIDATE("Document Date",ddate);
    PurchHeader.VALIDATE("Vendor Invoice No.",VIN);
    
    PurchHeader.MODIFY(TRUE);
    
Sign In or Register to comment.