Use of unbounded Text Element when Exporting xmlport to WS

primeap
Member Posts: 37
Hi
i use an xmlport to export a record as a webservice like described here:
http://www.kauffmann.nl/blog/index.php/2011/02/24/how-to-use-xmlports-in-web-services-2/#comment-4642
i have a question. when i use the xmlport and set an Element with Source Type “Text”
and on the properties i leave tha maxoccur to “unbounded”
in the .net this Element will be mapped as an array of string -> name[]..
ok, thats fine.
but my question is..
HOW CAN I FILL THE ARRAY IN NAVISION ON THE SAME RECORD?
Saying im exporting the saleline 123
in that i define a text element barcodes unbounded
so i can assign multiple barcodes to the same line..
regards
alex
i use an xmlport to export a record as a webservice like described here:
http://www.kauffmann.nl/blog/index.php/2011/02/24/how-to-use-xmlports-in-web-services-2/#comment-4642
i have a question. when i use the xmlport and set an Element with Source Type “Text”
and on the properties i leave tha maxoccur to “unbounded”
in the .net this Element will be mapped as an array of string -> name[]..
ok, thats fine.
but my question is..
HOW CAN I FILL THE ARRAY IN NAVISION ON THE SAME RECORD?
Saying im exporting the saleline 123
in that i define a text element barcodes unbounded
so i can assign multiple barcodes to the same line..
regards
alex
0
Best Answer
-
Hi Alex,
The solution is to use the table Item Cross Reference as a linked table in the XML Port. Just like you are used to in Reports.
Some things to note here:
* Set MinOccurs to zero. Otherwise you will get an error when no Item Cross Reference exists for a certain Item. In that case there will be no ItemCrossRef node, which breaks the rule of MinOccurrs = Once. The .Net code will fail on this (while NAV has no problem with generating it :-#).
* You can avoid any code in the XMLPort by using the SourceTableView and LinkFields properties.
This example results in Visual Studio as follows:
Succes!A good programmer makes al the right mistakes
My blog5
Answers
-
I would like to do something like in the printscreen..
but the output comes only for the last barcode..
there are two active barcodes in the item cross reference table
1000 STK Barcode 022255127790 Nein 12.01.12
1000 STK Barcode 22255127790 Nein 12.01.120 -
Hi Alex,
The solution is to use the table Item Cross Reference as a linked table in the XML Port. Just like you are used to in Reports.
Some things to note here:
* Set MinOccurs to zero. Otherwise you will get an error when no Item Cross Reference exists for a certain Item. In that case there will be no ItemCrossRef node, which breaks the rule of MinOccurrs = Once. The .Net code will fail on this (while NAV has no problem with generating it :-#).
* You can avoid any code in the XMLPort by using the SourceTableView and LinkFields properties.
This example results in Visual Studio as follows:
Succes!A good programmer makes al the right mistakes
My blog5 -
so genious!
thank you very much!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