Headers and Lines Using Dataport

gulamdastagirgulamdastagir Member Posts: 411
Hi navies,

I have created a dataport to import the lines from csv file.

But the Requierment is toalso cretate the header when a filter is selected on the dataport and then create the lines for the dataport.
Purchase header does not have any dataport fields only purchsae line has dataport fields


My dataport looks like this(wihout indentation)

Purchase Header
Purchase Line

I wrote the code on the Predataport
               "Purchase Header"."Document Type":="Purchase Header"."Document Type"::Order;
               NS.RESET;
               IF NS.GET('INV-NUM',10000) THEN
               LN:=INCSTR(NS."Last No. Used");


               "Purchase Header"."No.":=LN;
               "Purchase Header"."Buy-from Vendor No.":="Purchase Header".GETFILTER("Purchase Header"."Buy-from Vendor No.");
               "Purchase Header".INSERT(TRUE);


when i run the code unit the dialog box appears but nothing is accomplished.....thaks for any help
Regards,

GD

Comments

  • NaviDevNaviDev Member Posts: 365
    Insert a integer table in your data item. And filter it into 1 record only. On its dataport fields place the record fieldcaption. Ex. Record.FIELDCAPTION("Field name"). If you want this data item to be shown only if there is a filtering selected, then use the GETFILTER/GETFILTERS and SKIP function in the OnBeforeExportRecord trigger of the Integer data item.
    Navision noob....
Sign In or Register to comment.