So for my current project I have to export some data with dataports, for this I have to use data from 3 tables
*Company Information
*Cust. Ledger Entry
*Customer
(and roughly in this order)
So I looked it up how to do, I got the explanation just haven't been able to make it work. The dataport has to result in a csv file that follows this pattern
Company Information fields, Cust. Ledger Entry Fields,Customer fields,...
next record
So I thought to begin easy and do
Cust. Ledger Entry
Customer
dataport with the following code in the Customer OnBeforeRecord
Customer.SETFILTER("No.","Cust. Ledger Entry"."Customer No.");
But I'm getting the fields for customer under the lines of customer ledger entry and they also contain customers not in the ledger.
I'm looking into it further on my own, this is just to get some input from people who might know more then me
0
Answers
2) On RTC you need to use XMLPort, not dataport
3) If you want to combine more tables into one line, you need to write code for this (selec one "Master" table, base the export on it, and read the attached data from other tables through record variables).
MVP - Dynamics NAV
My BLOG
NAVERTICA a.s.
Variables:
CompanyInfo Record Company Information
Customer Record Customer
CustomerField Text 30
CLEField Text 30
CompanyField Text 30
OnAfterExportRecord()
CompanyInfo.GET;
Customer.GET("Cust. Ledger Entry"."Customer No.");
CustomerField := Customer.Name; //sample export from table 1
CLEField := "Cust. Ledger Entry".Description; //sample export from table 2
CompanyField := CompanyInfo.Name; //sample export from table 3
Dataport Fields:
Enabled SourceExpr StartPos Width CallFieldValidate Format
Yes CustomerField 0 0 No
Yes CLEField 0 0 No
Yes CompanyField 0 0 No
http://www.BiloBeauty.com
http://www.autismspeaks.org
Dataports don't run on the RTC. As Kine said he needs to do this in an XML port.
http://www.BiloBeauty.com
http://www.autismspeaks.org
Yes, I posted on the wrong forums, I only realised this after I submitted the message.(I've been practising on RTC for the past 2 months so force off habit ensued).
On the other hand I do also have to make this for rtc later on so....
I like to thank for the answers I'll try them out.
Ok, tried out the suggestions/answers the worked )
Now the next problem I'm facing is:
*Dynamic file nameThink I found the solution for this already
*Filters passed along from a codeunit
Solved and can this be moved to the correct forums
Note: it's a sample dataport, created in about a minute, to point you in the right direction based on your question. They are just sample fields to produce a sample output. You can change it to any fields you need.
But you are correct ..OnBeforeExportRecord() is the way to go.
Thanks.
http://www.BiloBeauty.com
http://www.autismspeaks.org