Dataport Item unable to Ident in V4 SP3
edisonl
Member Posts: 25
Hi Everyone,
1.I have created a dataport to import csv file.
2.Main table of importing records into payment journals, with
sub tables in Journal Dimension Line.
3.So for every Payment Journal insert, I'll need to create 2 records in Journal Dimension Line
(Shortcut Dimension 3 Code:STAFF & Shortcut Dimension 4 Code:Department as Dimension Code & Dimension Value to be populated from csv file, Template & Journal name from Payment Journal)
4.Though I tried to 'squeeze' all insertion coding into Payment Journal OnAfterImportRecord, the first record of department & staff values is not being populated into Journal Dimension Line table.
5.So I tried to work around by using 2 dataitems, First:for payment journal, Second:for Journal Dimension Line with Second Link to first by Template Name & Batch Name, but was prompt with error on file format not save as UPXML.
6.Again there was another attempt to circumnavigate the situations via no identation of second data item:Journal Dimension Line, this time round, the Journal Dimension Line doesnt run at all(I tried to display message in AfterImportRecord for Journal Dimension Line) but there was no use.
1.I have created a dataport to import csv file.
2.Main table of importing records into payment journals, with
sub tables in Journal Dimension Line.
3.So for every Payment Journal insert, I'll need to create 2 records in Journal Dimension Line
(Shortcut Dimension 3 Code:STAFF & Shortcut Dimension 4 Code:Department as Dimension Code & Dimension Value to be populated from csv file, Template & Journal name from Payment Journal)
4.Though I tried to 'squeeze' all insertion coding into Payment Journal OnAfterImportRecord, the first record of department & staff values is not being populated into Journal Dimension Line table.
5.So I tried to work around by using 2 dataitems, First:for payment journal, Second:for Journal Dimension Line with Second Link to first by Template Name & Batch Name, but was prompt with error on file format not save as UPXML.
6.Again there was another attempt to circumnavigate the situations via no identation of second data item:Journal Dimension Line, this time round, the Journal Dimension Line doesnt run at all(I tried to display message in AfterImportRecord for Journal Dimension Line) but there was no use.
1 Destination, Multiple Route
0
Comments
-
you can't indent in a dataport like a report - you can use a "get" to get the proper table & insert your records.0
-
Use all variables for the import, the Dataport Fields.
Use code to insert the data to the journal and at the same time to the Journal Line Dimension.
That way you can check all data before insert.
Forget about actually directly importing to the journal table, use a variable for the Gen. Journal Line.
Anyway, this is how I always do it.
Cheers,
ColinExperience is what you get when you hoped to get money0 -
colingbradley wrote:Use all variables for the import, the Dataport Fields.
Use code to insert the data to the journal and at the same time to the Journal Line Dimension.
That way you can check all data before insert.
Forget about actually directly importing to the journal table, use a variable for the Gen. Journal Line.
Anyway, this is how I always do it.
Cheers,
Colin
Dear Colin,
I did a variable insertion in data Item variable and do necessary validation in onAfterImport Record section, but it seems but Journal Dimension Line doesnt work.
Pardon me I like to clarify does your methods works in single data item- Journal Lines or 2 Data Items as in Journal Line & Journal dimension Line ?
Cheers1 Destination, Multiple Route0 -
Thanks for replying.. the 'funny' thing here is that only insertion into Journal Line table will be able to successfully perform all records insertion, I tried to insert coding to perform insert into 2 Journal Dimension Line records into Journal Line onAfterImport Record section. However the first record will always go 'missing' (Eg: 5 records, first records cant be inserted into Journal Line Dimension)Savatage wrote:you can't indent in a dataport like a report - you can use a "get" to get the proper table & insert your records.
Regards1 Destination, Multiple Route0 -
I do not understand how you are missing anything.
If you use the VALIDATE option for the dimensions that is all you need to do I would have thought.
"Journal Template Name" := 'GENERAL';
"Journal Batch Name" := 'CORRECTION';
"Line No." := LineNo;
VALIDATE("Account Type","Account Type"::"G/L Account");
VALIDATE("Account No.",AccNo);
VALIDATE("Posting Date",Pdate);
"Document No." := DocNo;
Description := 'Rev.' + Desc;
VALIDATE(Amount,Amnt);
IF Dim1 <> '' THEN
VALIDATE("Shortcut Dimension 1 Code",Dim1);
IF Dim2 <> '' THEN
VALIDATE("Shortcut Dimension 2 Code",Dim2);
"Source Code" := SrcCode; ///'GENJNL';Experience is what you get when you hoped to get money0 -
colingbradley wrote:I do not understand how you are missing anything.
If you use the VALIDATE option for the dimensions that is all you need to do I would have thought.
"Journal Template Name" := 'GENERAL';
"Journal Batch Name" := 'CORRECTION';
"Line No." := LineNo;
VALIDATE("Account Type","Account Type"::"G/L Account");
VALIDATE("Account No.",AccNo);
VALIDATE("Posting Date",Pdate);
"Document No." := DocNo;
Description := 'Rev.' + Desc;
VALIDATE(Amount,Amnt);
IF Dim1 <> '' THEN
VALIDATE("Shortcut Dimension 1 Code",Dim1);
IF Dim2 <> '' THEN
VALIDATE("Shortcut Dimension 2 Code",Dim2);
"Source Code" := SrcCode; ///'GENJNL';
Dear Colin,
Thanks for the tips, I forgotten to mention that its the Shortcut Dimension 3 & 4 Code that I like to insert my Department & Staff Code/Values into.
Regards1 Destination, Multiple Route0 -
edisonl wrote:colingbradley wrote:I do not understand how you are missing anything.
If you use the VALIDATE option for the dimensions that is all you need to do I would have thought.
"Journal Template Name" := 'GENERAL';
"Journal Batch Name" := 'CORRECTION';
"Line No." := LineNo;
VALIDATE("Account Type","Account Type"::"G/L Account");
VALIDATE("Account No.",AccNo);
VALIDATE("Posting Date",Pdate);
"Document No." := DocNo;
Description := 'Rev.' + Desc;
VALIDATE(Amount,Amnt);
IF Dim1 <> '' THEN
VALIDATE("Shortcut Dimension 1 Code",Dim1);
IF Dim2 <> '' THEN
VALIDATE("Shortcut Dimension 2 Code",Dim2);
"Source Code" := SrcCode; ///'GENJNL';
Dear Colin,
Thanks for the tips, I forgotten to mention that its the Shortcut Dimension 3 & 4 Code that I like to insert my Department & Staff Code/Values into.
Regards
Dear Colin,
Manage to settle it already, I used Clear() thats all.
Regards1 Destination, Multiple Route0 -
how i can add0
-
Wassim81, please do not hijack a thread, especially if your question is not or only very lightly related to the existing thread.
To answer your question: You need to be able to define an unambiguous record separator in order to be able to use a dataport. If this is not possible you either need to preprocess your import file, or you need to import it some other way (i.e. coding it in C/AL using file operations...).
A dataport always considers each line of the import file to be one record. You can alter the definition on "line" by setting the RecordSeparator property.0 -
thanks0
Categories
- All Categories
- 75 General
- 75 Announcements
- 66.7K Microsoft Dynamics NAV
- 18.8K 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
- 610 NAV Courses, Exams & Certification
- 1.9K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 251 Dynamics CRM
- 103 Dynamics GP
- 6 Dynamics SL
- 1.5K Other
- 991 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 28 Design Patterns (General & Best Practices)
- Architectural Patterns
- 9 Design Patterns
- 4 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1K General Chat
- 1.6K Website
- 77 Testing
- 1.2K Download section
- 23 How Tos section
- 249 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions

