AppendToDocumentList with outerinner documentlists

Hi,

I’m attempting to map a document to another document, both docs have parent and child document lists. (Orders and Line Items)

Basically,
I loop over the orders
Map the order information to a temp record (clone of the receiving doc)
appendToDocumentList (the temp to the receiving doc) -Drop temp
–start inner loop for item detail
–map item detail to cloned temp doc
–appendToDocumentList (temp to receiving doc) - Drop Temp

I am also dropping the toList/fromList/fromItem variables.

Unfortunately, the items seem to just reference each other…repeating the same item detail even for each order. Orders information works fine.

thanks in advance!

I believe the pipeline may not dropping the temp documents properly and you might have missed some reference still to be dropped.So,please make sure while stepping thru and find the culprit that overwritting the itemlist.

Sometimes not dropping of appropriate temp/variables in the pipe may cause the problem.

HTH.

Actually, I’m dropping the temp variables on both the outer loop and inner loop. As well as the toList/fromList/fromItem variables.

Any other thoughts or experiences?

Thanks again!

I received some help on this and got it to work…this is what we did for anyone who is interested:

start parent loop
-Looped over parent orders (Map the order to a temp order record)

–start inside loop

—map order detail to temp order detail doc

—appendToDocumentList (transformer inside map) temp order detail as child of temp order header

-(back to parent loop) appendToDocumentList flow step:
temp order header as the fromItem,
toList is final document reference