DataItemSeparator---No blank between two dataitem

Oneway
Member Posts: 53
Hi all,
How can I import a Sales Order (Sales Header, sales Lines) using dataport? For text file, there is no blank line between header and line.
looks like below
H H1 H2 H3
header
L L1 L2 L3
line
L L4 L5 L6
line
thanks in advance.
How can I import a Sales Order (Sales Header, sales Lines) using dataport? For text file, there is no blank line between header and line.
looks like below
H H1 H2 H3
header
L L1 L2 L3
line
L L4 L5 L6
line
thanks in advance.
0
Comments
-
The conventional way is to import all Sales Header 1st followed by all Sales Lines.NAV - Norton Anti Virus
ERP Consultant (not just Navision) & Navision challenger0 -
in your txt file there shold be a record identifier e.g.: lines that begin with 'H' are headers and lines that begin with 'L' are lines...
you will surely have to write some code in order to place the values in the right tables.
If I don't understood your problem...tell me if something's missing...0 -
the dataitem seperator is usually : <<NewLine><NewLine>>
if this is what you are talking about then view the properties of the blank under the last dataitem to change it0 -
what i try to do is importing sales order.
every file contain one sales order (one header and multi-lines).
The filed separator is tab----this is no problem.
The problem i met is the DataItemSeparator. On the file, first line is header, from second line are lines. layout as below:
H H1 H2 H3
L L1 L2 L3
L L4 L5 L6
It is simple to import the data if there is a blank line between header data and line data.
Unfortunatly, there is no blank line!!! ](*,)
How can I import them using dataport? :?:0 -
if you hit F1 on the dataitem seperator field it gives you the answer
:oops:0 -
The default value is "<<NewLine><NewLine>>", which is one blank line between dataitems. NAV puts the < and the > around default properties, so if you want to set a custom value, you need to remove the outer < and >.
Try entering "<NewLine>" and try again.0 -
Come on! have a play please.
The <NewLine> does not work. The dataport just read one line of the Sales Line Data.0 -
then it depends on how your datafile is setup..
Are you specifying a different Line No. for each sales line?0 -
This is no matter of the line no.
I created two testing tables. one is header another is line. both of them have three fields, and first field is premiry key.
then try to import below data. I use <NewLine> as dataitem separator.
ather imported, in the second table just one line data: "L1 L2 L3"
H1 H2 H3
L1 L2 L3
L4 L5 L60 -
You do realize that for the header to be imported you must have
Specify a "Document Type" & a "No."
For the Sales Line you must
Specify a "Document Type", a "Document No." & a "Line No".
How does your dataport know when the data for the next line is beginning if it's 1 long line..(if I understand correctly)0 -
more basic steps here: http://www.mibuso.com/forum/viewtopic.php?t=211210
-
Oneway wrote:Come on! have a play please.
The <NewLine> does not work. The dataport just read one line of the Sales Line Data.
The more I think of it the more I think it's not going to work with one header record and an unknown number of line records. You're going to have to import into variables and keep track of the number of records inside the dataport. For the first line you put the values into a Header record, for the second line and on you put the values into line records.0 -
All right. Thanks guys!0
-
Sorry to gave a bad example.
Here is the new example.
Doc No. Doc Type Sell-to Cust No.
Doc No. Doc Type Line No. Sell-to Cust No. Type No.
Below is waht I will receive from the text file:
SO-1001 Order C00019
SO-1001 Order 10000 C00019 ITEM IT10002
SO-1001 Order 20000 C00019 ITEM IT10003
SO-1001 Order 30000 C00019 ITEM IT10004
SO-1001 Order 10000 C00019 ITEM IT10002
...................................
...................................
Could you please tell me how to import it via dataport? expecially, what the DataItemSeparator should I use? (We just assume no validate needed all data is examed)0 -
One more time...
It's not possible to do it with multiple dataitems, because there is nothing specific that separates the two. The reason why one NewLine didn't work is because after the first line record it thought the dataitem was done due to the NewLine.
You will have to import the fields into variables and program the records yourself.0 -
Oneway wrote:(We just assume no validate needed all data is examed)
In addition, validation also fills in other fields upon doing so.
Like when the customer # is entered - there Terms are also inserted, dimensions, amongst other fields. So don't just blow off Validating fields just because the data is correct.
ps in your example line data 1 & 4 are the same (typo?)0 -
Thanks all of your for help.
especially for DenSter :idea:
I tried several times. You are right. It's no possible to do like that.
Now I am trying to import like below format.
SO-1001 Order C00019
####
any characters but not blank line
SO-1001 Order 10000 C00019 ITEM IT10002
SO-1001 Order 20000 C00019 ITEM IT10003
SO-1001 Order 30000 C00019 ITEM IT10004
SO-1001 Order 40000 C00019 ITEM IT10005
Is it possible?0 -
If you have control over the file layout, why not put a blank line in between, so it looks like this:
SO-1001 Order C00019 SO-1001 Order 10000 C00019 ITEM IT10002 SO-1001 Order 20000 C00019 ITEM IT10003 SO-1001 Order 30000 C00019 ITEM IT10004 SO-1001 Order 40000 C00019 ITEM IT10005
You've probably already ruled that out, but I had to try. That way your dataport with two dataitems would work without a problem. Is there a technical reason why you can't put a blank line in there?
0 -
Thanks DenSter,
unfortunately, the layout is out of my control. The Text file is from 3'd Party mapping provider. They can insert any characters but not blank line .
This is the core/key problem!!! This is the reason why I looking for help. ](*,)0 -
I don't see any other way but to import all the fields into variables, and manage the records from there.0
-
Oneway wrote:They can insert any characters but not blank line .
One of the choices of DataItemSeperator is
"other Strings" -<The Literal String Entered>
If this 3rd party place can enter <Next> or whatever as a header for the sales line section you should be ready to go.
I can't believe they can't add a false header to the lines.0 -
You could also import everything into one Sales Line dataitem, and create a header record for the first line.0
-
true!, the sales line contains
-Order Number
-Document Type
-Sell-to Customer No.
Should be enuf to INSERT into the sales header table using the variables it's being imported into.
Variables:
-vDocType
-vDocNo
-vCustNo
OnAfterImportRecord()SalesHeader."No." := vDocNo"; SalesHeader."Document Type" := vDocType; SalesHeader."Sell-To Customer No." := vCustNo"; SalesHeader.INSERT; SalesLine."Document No." := vDocNo; SalesLine."Document Type" :=VDocType; SalesLine."Sell-to Customer No." :=vCustNo; blah blah blah
Don't forget to VALIDATE!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