How to run Dataport with more than one record?

Polar
Member Posts: 32
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 ?
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
0
Comments
-
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!0 -
Checked up and tested on 6 tables in one dataport... works
Thanks much.
Muchas gracias.
Molte grazie.
Danke schön.
Merci beaucoup.
Большое спасибо.keep it simple0 -
Not at all
Всегда пожалуйста0
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.6K Microsoft Dynamics NAV
- 18.7K NAV Three Tier
- 38.4K NAV/Navision Classic Client
- 3.6K Navision Attain
- 2.4K Navision Financials
- 116 Navision DOS
- 851 Navision e-Commerce
- 1K NAV Tips & Tricks
- 772 NAV Dutch speaking only
- 617 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 320 Dynamics CRM
- 111 Dynamics GP
- 10 Dynamics SL
- 1.5K Other
- 990 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 35 Design Patterns (General & Best Practices)
- 1 Architectural Patterns
- 10 Design Patterns
- 5 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1.1K General Chat
- 1.6K Website
- 83 Testing
- 1.2K Download section
- 23 How Tos section
- 252 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions