NetSuite Item Fulfillment

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.

Hi Trevor,

The expressions on the left side of your mapping table are truncated. Can you please paste them here?

1: $[‘soapenv:Body’].getResponse.readResponse.record[‘tranSales:itemList’][‘tranSales:item’]

2: $[‘soapenv:Body’].getResponse.readResponse.record[‘tranSales:customFieldList’][‘platformCore:customField’].custbody_tvone_original_sales_order[’@internalId’]

3: true

4: False

Try copying the entire itemList rather than individual items:

mapped to

If you do this you can drop the last two mappings.

Actually, I think it’s more complicated than that. Let me follow up with you tomorrow on this.

Ok sounds great!

I did try this as you mentioned just to see what it would do and I got the following error. These two errors are what I have been seeing the most of.

Do you mind showing me the whole pipeline? Are you starting with a Sales Order?

So this starts with a custom search for Sales order that have been fulfilled out of one subsidiary. We are then getting the item fulfillment record of that SO and then mapping it to the Original SO from our other subsidiary and fulling that SO. That is the goal. Essentially what this is doing is handling what are called ‘Intercompany Transactions’ and we are automating where Netsuite currently isn’t. I have staff that manually go in and create these IF’s even though they are the exact same as the originating transaction. Let me know if you need more info on this Pipeline and need anything else opened and shown.

1 Like

How are you “getting the item fulfillment record of that SO”? I see an item list inside an SO’s details and each of those has quantityFulfilled, etc, but I’m not seeing any references to item fulfillment objects. But I think you can just create the new item fulfillments based on the details available in the SO’s item list, no?

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.

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.

I see. What is in the IF transactions that isn’t available in the SO itself, if you do a Get on the SO?

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’?

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.

It’s documented here:

sneaky! I like that, this was what I was beating my head with earlier!

I am going to try your way with the SO because I just verified that the SO does have the Serial numbers as well. Would you still keep the search to grab the SO?

I think that should work if you uncheck “Body Fields Only” on the Search. Otherwise it won’t include the itemList details.

Seems like this might be the solution however I am running into one error right now with the Inventory Detail. Any insight?

here is how the mapper looks

here is the fill truncated last line