Dataport Write file Manually

flint
Member Posts: 44
Hi,
I develop a DataPort that would export from a dataitem table.
I want to iterat a number of time (determined on Runtime) on a record.
is there any way to make the dataport iterate a number of time on a record ?
Thanks
I develop a DataPort that would export from a dataitem table.
I want to iterat a number of time (determined on Runtime) on a record.
is there any way to make the dataport iterate a number of time on a record ?
Thanks
0
Comments
-
Maybe you can explain a little more what you are trying to do.
What table do you want to export from?
It sound like you want to enter a number (call it X) and have the dataport loop X number of times exporting the same data X amount of times.
Or did I lose something in the translation?0 -
It's exactly what i want to do.
Actually I want to export the balance of a given account calculatade by business unit (in a consolidation company).
The dataport is based on table 15, so for every account he must calculate the balance by setting :
the BU and the posting date.so we have different BU so the dataport must iterate a number of time(number of BU determinated at RUNTIME) on every record.
the way i found was to iterate manually on the triggers
OnAfterGetRecord and then write the dta manually.it's not very funny to do this and i think there must be a way more simple !!!
thanks for your help0 -
Table 15 is the G/L Account table.
Isn't the data you need in Table 17 G/L Entries?
I think I'm confused over what you are looking to do. ](*,)0 -
Hi,
It's so simple what i want to to :
- Export the balance of every Account by using the table G/L Account and
calculate the balance by calling the magic function CALCFIELDS("Balance") after stting some filter on this FlowFields.
YES the data is in G/L Entries(but how care :roll: ).
The problem is that i'm doing this on a consolidation Company, so for every Account i need to calculate the Balance by Business Unit.
So in a perfect world it would be somthing like :
For i:=0 to THE_NUMBER_OF_BUSINESS_UNIT DO BEGIN
"Business Unit Code" := CurrCode;
CALCFIELDS("Balance");
END;
Unfortunally, in a Dataport it's not possible to iterate several times on a record.
My question is : is there any way to iterate on a record (not manually of course) or the only way to do this is to iterate manually on the trigger:
OnAfterGetRecord()?
Thanks0 -
Hi Flint,
I guess by BU you mean different companies?
If true then you could do the following
create a new Codeunit
OnRun section
If Company Find('-') then
REPEAT
MyDataPort.SetCompany(Company.Name);
MyDataport.RUN;
UNTIL Company.Next = 0;
<Edit>
You must not include your consolidated company of course
<End Edit>
DataItem Name
Company Company
in your dataport
SetCompany(LvName) This is the new fuction called from you codeunit
CompanyName := LvName; // Type Text variables
OnPreDataItem section
GLAcct.CHANGECOMPANY(CompanyName);
OnBeforeExport
CALCFIELDS(Balance);
Hope this helps
Albert0
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