02-03-2021 01:36 PM
Hi Team,
I am working with a pipeline to grab a Item Fulfillment record under one subsidiary and then transitioning that IF to a new IF in the other. It is a 1 for 1 transaction on our side, so the data that we pull will be the same as the data input under the new company. That being said I continue run into the error below. I will post my mapping as well. I have tried a few different things and still seem to cum up short on this one and would love some insight.
Here is the mapping currently.
02-04-2021 10:32 AM
Here is a pipeline I created that might help.
NS Copy SO Item Fulfillments_2021_02_04.slp (8.9 KB)
It looks like this:
This assumes the existence of two SalesOrders for the same items. One SO has a corresponding ItemFulfillment, the other doesn’t. The pipeline has two parameters corresponding to the internal ID of each of these SOs: CopyFromSalesOrderId and CopyToSalesOrderId. It just gets the “from” SO, then creates an IF for the “to” SO based on the itemList of the “from” SO. It doesn’t ever get the IF corresponding to the “from” SO, since I’m not sure that it needs to. All the information it needs to create the IF is in the details of the “from” SO.
Let me know if this helps.
02-04-2021 10:32 AM
Under the EU Search mapper I am using the following call to grab the transaction
jsonPath($, “$searchRecord.columns.fulfillingTransactionJoin.internalId[*].searchValue.internalId”)
Then I am using that same transaction join internal ID to go and get me the record under the NS get. That allows me to to have the IF transactions record that I want to map into the new record.
02-04-2021 10:34 AM
I see. What is in the IF transactions that isn’t available in the SO itself, if you do a Get on the SO?
02-04-2021 10:39 AM
The Serial numbers that have been shipped from the originating SO. That is what I would be missing
However your sl.ensureArray(…) maybe that might work in my case. What is this doing in your ‘Root Mapper’?
02-04-2021 10:41 AM
When an SO has multiple items, $[‘soapenv:Body’].getResponse.readResponse.record[‘tranSales:itemList’][‘tranSales:item’] is an array. However, when SO has a single item, it is just an object. The sl.ensureArray() is a way of dealing with this. If the argument is an object, it wraps it in an array. If the argument is an array, it just returns that. So either way, the result is an array.