How to run Dataport with more than one record?

PolarPolar Member Posts: 32
edited 2004-08-05 in Navision Attain
I made a dataport, exporting few tables.
Problem: How to run it with recordfilters I need?
(I want ot export only record changed from startdate)
If in dataport was only one record parameter there would be no problem.

record1.SETFILTER("Last Date Modified",'>04.05.04');
DATAPORT.RUN(ID,FALSE,record1);

But if there are few records to import in dataport, ERROR apears.

Or only the way to make dataport for each record ?
keep it simple

Comments

  • kvbkvb Member Posts: 107
    Hi,
    if you have 2 dataitems in your dataport and want to filter both of them
    first you should create a function like this in your dataport:
    SetParams(pt_Rec1View : Text[1024];pt_Rec2View : Text[1024])
    gt_Rec1View := pt_Rec1View;
    gt_Rec2View := pt_Rec2View;
    

    where gt_Rec1View, gt_Rec2View are Text[1024] global variables.

    In Rec1DataItem OnPreDataItem trigger you should write:
    Rec1DataItem.SETVIEW(gt_Rec1View );
    

    In Rec2DataItem OnPreDataItem trigger you should write:
    Rec2DataItem.SETVIEW(gt_Rec2View );
    

    And dataport you should run like this:
    //
    //....set filters you need on your recs
    
    ldt_YourDataport.SetParams(record1.GETVIEW, record2.GETVIEW);
    ldt_YourDataport.RUN;
    

    where ldt_YourDataport is the local variable(Type=Dataport, SubType=YourDataport).

    Hope it helps! :D
  • PolarPolar Member Posts: 32
    Checked up and tested on 6 tables in one dataport... works :D

    Thanks much.
    Muchas gracias.
    Molte grazie.
    Danke schön.
    Merci beaucoup.
    Большое спасибо.
    :D
    keep it simple
  • kvbkvb Member Posts: 107
    Not at all :D

    Всегда пожалуйста :wink:
Sign In or Register to comment.