Dataport Purchase Header/Purchase Line

Red-EagleRed-Eagle Member Posts: 107
I am making a data export where i need information from te purchase header and the purchase line.

I have the purchase header as data item and made the variable purchaserec. In the code I write this:

Purchase Header - OnBeforeExportRecord()
IF Purchaserec.GET("Purchase Header"."Document Type","Purchase Header"."No.") THEN BEGIN
vPurDesc := Purchaserec.Description;
END;


Getting information form the pruchase header is no problem of course and i get the extra cell form vPurDesc only it says ""

Is it possible this way or need i to make a temp table with the data item integer?

Answers

  • matttraxmatttrax Member Posts: 2,309
    Why do you have that code at all?

    You are retrieving the same record that you are exporting. Just add the Description field to your Dataport fields.
  • Red-EagleRed-Eagle Member Posts: 107
    Because purchaserec= purchase line!

    I neeed the following fields:
    - purchase header."no."
    - purchase header."Order Date"
    - purchase header."Ship-to Name"
    - purchase line."Vendor Item No."
    - purchase line."Quantity"
    and a few more
  • SavatageSavatage Member Posts: 7,142
    Purchase Header - OnBeforeExportRecord()

    it appears your dataitem is purchase header.
    do you want to get purchase lines or header?

    for purchase lines you'll need to add line no to the "get"

    i suggest you use purchase lines as the dataitem & get the header!
  • Red-EagleRed-Eagle Member Posts: 107
    Thnx you very much! Now i turned it around and it's working the way i want it.
Sign In or Register to comment.