XML Port Problem
bangswit
Member Posts: 265
hi... why everytime I import data from XML file
it only import 1 record (only the last record from xml file)
could anyone give me the information?
thanks
it only import 1 record (only the last record from xml file)
could anyone give me the information?
thanks
0
Answers
-
we need more info.
such as what is the structure of xml. what is the target table. what fields are being used. what is the PK of the table.0 -
bangswit wrote:hi... why everytime I import data from XML file
it only import 1 record (only the last record from xml file)
could anyone give me the information?
thanks
Do one thing. Open Object Designer.Select Table in it.In that select your Target Table and click button Design. Now go to the Menu and in that select View->Keys and see that you have added proper combination of keys or not. Suppose if there is a only one key and you have a record which have Primary key as a combination of 3 key than it will input only single record for that.
For Example
I have a table Vehicle and this is a design for it
Enabled Field No. Field Name Data Type Length Description
Yes 10 Model Code 7
Yes 20 Serial No Code 6
Yes 30 Description Text 8
Yes 40 TransmissionText 11
Yes 50 List Price Integer
Yes 60 Date of Manufacturing Date
and i didnt set any keys so bydefault key will be Model.
I am importing following records
FIAT 1000 Black 5-Speed 200000 01/31/10
MAZDA 7500 Blue Automatic 300000 01/15/10
FIAT 2000 Ivory Automatic 400000 03/31/10
MAZDA 5500 Red 5-Speed 500000 02/10/10
In above you can see that i have 4 records but when i am going to import record it will import
FIAT 1000 Black 5-Speed 200000 01/31/10 and after that
MAZDA 7500 Blue Automatic 300000 01/15/10
but when its going to import
FIAT 2000 Ivory Automatic 400000 03/31/10 you can see that Model is only primary key and with MODEL FIAT is already inserted so it wont insert
FIAT 2000 Ivory Automatic 400000 03/31/10
MAZDA 5500 Red 5-Speed 500000 02/10/10 both this record.
For import all the records i have to set Model,Serial No as my first key.
Hope you got my point.0 -
this is my table
Enabled Field No. Field Name Data Type Length Description
Yes 1 sa_out_cd Code 20
Yes 2 rcp_no Code 20
Yes 3 bn_dt Text 30
Yes 4 prod_cd Code 20
Yes 5 prod_nm Text 30
Yes 6 sa_qty Decimal
Yes 7 sa_amount Decimal
Yes 8 discount Decimal
Yes 9 TTLAMT Decimal
the bold one is the key...
no matter how the data I import
it only import 1 record... last one0 -
can you give your some sample data for it?0
-
sa_out_cd rcp_no bn_dt prod_cd prod_nm sa_qty sa_price sa_amount discount
UM 526 1 9430013IZ--BU U.R.S & inc. 1 30.9 30.9 6.18
UM 527 1 3904014PZ--BL U.R.S & inc. 1 35.9 35.9 0
UM 528 1 3801032PZ--WH U.R.S & inc. 1 43.9 43.9 8.78
UM 529 1 3902007PZ--RD U.R.S & inc. 1 29.9 29.9 5.98
UM 530 2 3804013SZ--KH U.R.S & inc. 1 49.9 49.9 9.98
UM 530 3 3801064CZ--BL U.R.S & inc. 1 39.9 39.9 21.95
this is the sample data0 -
I already tried change the keys
to be prod_cd
but it still the same...I only could import 1 record
by the way,the export is the sample... no matter how many records..only export 1 record0 -
Are you importing XML file or Text file?
If it is text file than is it Variable or fixed?0 -
alok_dida wrote:Are you importing XML file or Text file?
If it is text file than is it Variable or fixed?
I import xml file
here is the sample data
<Data>
<detail sa_out_cd="UM" bn_dt="2010-05-01T00:00:00" rcp_no="000526" prod_cd="9430013IZ--BU" prod_nm="U.R.S & inc." sa_qty="1.0000" sa_amount="30.9000" discount="6.1800" TTLAMT="535.9000" />
<detail sa_out_cd="UM" bn_dt="2010-05-01T00:00:00" rcp_no="000527" prod_cd="3904014PZ--BL" prod_nm="U.R.S & inc." sa_qty="1.0000" sa_amount="35.9000" discount="0.0000" TTLAMT="450.0000" />
<detail sa_out_cd="UM" bn_dt="2010-05-01T00:00:00" rcp_no="000528" prod_cd="3801032PZ--WH" prod_nm="U.R.S & inc." sa_qty="1.0000" sa_amount="43.9000" discount="8.7800" TTLAMT="528.8000" />
<detail sa_out_cd="UM" bn_dt="2010-05-01T00:00:00" rcp_no="000529" prod_cd="3902007PZ--RD" prod_nm="U.R.S & inc." sa_qty="1.0000" sa_amount="29.9000" discount="5.9800" TTLAMT="468.6000" />
</Data>0 -
bangswit wrote:alok_dida wrote:Are you importing XML file or Text file?
If it is text file than is it Variable or fixed?
I import xml file
here is the sample data
<Data>
<detail sa_out_cd="UM" bn_dt="2010-05-01T00:00:00" rcp_no="000526" prod_cd="9430013IZ--BU" prod_nm="U.R.S & inc." sa_qty="1.0000" sa_amount="30.9000" discount="6.1800" TTLAMT="535.9000" />
<detail sa_out_cd="UM" bn_dt="2010-05-01T00:00:00" rcp_no="000527" prod_cd="3904014PZ--BL" prod_nm="U.R.S & inc." sa_qty="1.0000" sa_amount="35.9000" discount="0.0000" TTLAMT="450.0000" />
<detail sa_out_cd="UM" bn_dt="2010-05-01T00:00:00" rcp_no="000528" prod_cd="3801032PZ--WH" prod_nm="U.R.S & inc." sa_qty="1.0000" sa_amount="43.9000" discount="8.7800" TTLAMT="528.8000" />
<detail sa_out_cd="UM" bn_dt="2010-05-01T00:00:00" rcp_no="000529" prod_cd="3902007PZ--RD" prod_nm="U.R.S & inc." sa_qty="1.0000" sa_amount="29.9000" discount="5.9800" TTLAMT="468.6000" />
</Data>
Hey bangswit
Its able to import all the records in my table. I get parsing error before, because of '&' in prod_nm="U.R.S & inc." and after removing it when i try to import records its working fine.0 -
alok_dida wrote:bangswit wrote:alok_dida wrote:Are you importing XML file or Text file?
If it is text file than is it Variable or fixed?
I import xml file
here is the sample data
<Data>
<detail sa_out_cd="UM" bn_dt="2010-05-01T00:00:00" rcp_no="000526" prod_cd="9430013IZ--BU" prod_nm="U.R.S & inc." sa_qty="1.0000" sa_amount="30.9000" discount="6.1800" TTLAMT="535.9000" />
<detail sa_out_cd="UM" bn_dt="2010-05-01T00:00:00" rcp_no="000527" prod_cd="3904014PZ--BL" prod_nm="U.R.S & inc." sa_qty="1.0000" sa_amount="35.9000" discount="0.0000" TTLAMT="450.0000" />
<detail sa_out_cd="UM" bn_dt="2010-05-01T00:00:00" rcp_no="000528" prod_cd="3801032PZ--WH" prod_nm="U.R.S & inc." sa_qty="1.0000" sa_amount="43.9000" discount="8.7800" TTLAMT="528.8000" />
<detail sa_out_cd="UM" bn_dt="2010-05-01T00:00:00" rcp_no="000529" prod_cd="3902007PZ--RD" prod_nm="U.R.S & inc." sa_qty="1.0000" sa_amount="29.9000" discount="5.9800" TTLAMT="468.6000" />
</Data>
Hey bangswit
Its able to import all the records in my table. I get parsing error before, because of '&' in prod_nm="U.R.S & inc." and after removing it when i try to import records its working fine.
yes, I also succeed
i just change the sequance of xml port
thanks a lot
0 -
what was the problem?
Change the sequence of XMLPort.. I didnt get you.0 -
alok_dida wrote:what was the problem?
Change the sequence of XMLPort.. I didnt get you.
FIRST
TagName TagType SourceType DataSource
Data Element Table Sample (EASIPOS)(Sample (EASIPOS))
detail Element Text <detail>
and then I change to be like this
TagName TagType SourceType DataSource
Data Element Text <Data>
detail Element Table Sample (EASIPOS)(Sample (EASIPOS))0
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
