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
Answers
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.12
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!
My blog
thank you very much!