... <Comments> <Comment>Comment 1</Comment> <Comment>Comment 2</Comment> ... <Comment>Comment n</Comment> </Comments> ...
Shipment Element Table TransShipHeader(Transfer Shipment Header) ... Comments Element Table InventoryCommentLine(Inventory Comment Line) SourceTableView: WHERE(Document Type=CONST(Posted Transfer Shipment)) LinkTable: TransShipHeader LinkFields: No.=FIELD(No.) MinOccurs: Zero MaxOccurs: Once Comment Element Field InventoryCommentLine::Comment MinOccurs: Zero MaxOccurs: Unbounded
<Comments> <Comment>Comment 1</Comment> </Comments>
Comments
RIS Plus, LLC
Thank's, but if I set the MaxOccurs on 'Comments' to Unbounded, I get this:
?????
Bob
The issue I believe is Navision doesn't allow multiple of the same elements when exporting, but it will do this fine when importing. I suppose it just does not know how to interpret it.
The only way I can see you being able to do this is to do the following:
1) Remove the 'Comment' element within the 'Comments' node 2) Export the XMLport to a Stream to be manipulated using the MSXML Automation
a) Export to a Temporary Blob b) Load via Stream to XML Dom Document
3) Cycle through the InventoryCommentLine (with applied filters) and add each Comment line using the automation4) And finally exporting to file (which can be easily done using the automation; XMLDom.save('C:\Path\File.xml'))
If you would like some sample code let me know and I'll whip some up for you.
(You can download the latest version of MSXML at this link.)
Yikes!
Before posting this topic I searched the forum and saw this stuff mentioned.
Before jumping off that cliff thouhg, there's got to be an easier way to get the comments out. As it stands, the specs for the receiving end of this file are not defined yet - so I'm pretty free to set the output format as I like. Would you see anything wrong (XML-wise) with this:
If that looks kosher, then I guess my next question is how to produce it.
Is this the right track:
- Change Comments to Element, Text
- In Comments - Export::OnBeforePassVariable()
- Define a local record variable for the comments table
- Set filters to get the ones I want
- Iterate through the records, appending the text to Comments
What do you think?
Bob
too late - I tried it:
(Comments, Element, Text)
In the output file, I get:
What do you think?
Bob
But if that will work for you then sure go for it.
Also, the code in my prior post was wrong. NewComments was the name I used for testing, and I didn't edit all the occurances to 'Comment' before posting. The code should read:
and the output:
Thank's for your help Xypher.
Bob
I would recommend switching from DataType: Text to BigText and do the following,
I had seen that coming, but hadn't gone after it yet.
Right now I'm wrestling with trying to add Lot No. information elements to each line item. What a swamp!
I've looked at the way the info is assembled:
Table 5745: Transfer Shipment Line.ShowItemTrackingLines(), calls:
Codeunit 6500: Item Tracking Management.CallPostedItemTrackingForm(DATABASE::"Transfer Shipment Line",0,"Document No.",'',0,"Line No.");
CallPostedItemTrackingForm creates a a temporary Item Ledger Entry table, and then calls Item Tracking Management.RetrieveILEFromShptRcpt(), passing it the table to be filled up with the Lot No lines.
Looks easy enough to use/steal/copy/whatever. But - I think there's a(nother) brick wall coming because I haven't found a way to use a temporary table as the data source for an XML port.
Do you think there's an easier way to find/export the lot no information?
Bob
Other than that I don't really know what is involved with "Lot No. Information", I'm just a Jr. Programmer.
I kind of lost track of this thread, but it should be possible to make this work.
RIS Plus, LLC