Hi @tylerlamparter,
So I recreated the Import completely from scratch per your recommendation and ensured that none of the mappings had First record ticked on, and still no joy, same problem, the record is still being allocated line 0 and line 1 respectively when it runs its loop, rather than reading our mapping of 1 and 2.
importing record {"index":0,"retryCount":0}
{"nlobjRecordType":"itemfulfillment","nlobjFieldIds":{"celigo_nlobjTransformId":3740358,"celigo_recordmode_dynamic":"true","celigo_replaceAllLines_item":"true","trandate":"26/10/2023","shipstatus":"Packed"},"nlobjSublistIds":{"item":[{"quantity":"1","itemname":"MFGA01","location":"VIC Warehouse","line":"1","_keys":["location","line"],"celigo_inventorydetail":{"nlobjRecordType":"inventorydetail","nlobjFieldIds":{"quantity":"1"},"nlobjSublistIds":{"inventoryassignment":[{"quantity":"1","binnumber":"BULKDD"}]}}},{"quantity":"1","itemname":"MFGA03","location":"VIC Warehouse","line":"2","_keys":["location","line"],"celigo_inventorydetail":{"nlobjRecordType":"inventorydetail","nlobjFieldIds":{"quantity":"1"},"nlobjSublistIds":{"inventoryassignment":[{"quantity":"1","binnumber":"BULKDD"}]}}}]}}
nlapi calls registered for $R:
r = NRecord.transform({"fromType":"salesorder","fromId":3740358,"toType":"itemfulfillment","defaultValues":{"recordmode":"dynamic"}});
r.setValue({"fieldId":"trandate","value":"26/10/2023"});
r.setText({"fieldId":"shipstatus","text":"Packed"});
r.setCurrentSublistText({"sublistId":"item","fieldId":"location","text":"VIC Warehouse"});
r.setCurrentSublistText({"sublistId":"item","fieldId":"location","text":"VIC Warehouse"});
r.selectLine({"sublistId":"item","line":0});
r.setCurrentSublistValue({"sublistId":"item","fieldId":"itemreceive","value":false});
r.selectLine({"sublistId":"item","line":1});
r.setCurrentSublistValue({"sublistId":"item","fieldId":"itemreceive","value":false});
r.selectLineItem({"sublistId":"item","line":0});
r.setCurrentSublistValue({"sublistId":"item","fieldId":"itemreceive","value":true});
r.setCurrentSublistValue({"sublistId":"item","fieldId":"quantity","value":"1"});
r.setCurrentSublistValue({"sublistId":"item","fieldId":"itemname","value":"MFGA01"});
r.setCurrentSublistText({"sublistId":"item","fieldId":"location","text":"VIC Warehouse"});
r.setCurrentSublistValue({"sublistId":"item","fieldId":"line","value":"1"});
sr = r.getCurrentSublistSubrecord({"sublistId":"item","fieldId":"inventorydetail"});
r.commitLine({"sublistId":"item"});
As a work-around I also tried subtracting 1 from the line_id field in the mappings using:
{{ subtract line_id 1 }}
... with the thought that even if the line_id starting at 0 when the records are grouped as you say, subtracting 1 from the line_id we're mapping (which was generated from the original Netsuite PO we send to the 3PL warehouse) should then match the line_id's Celigo has generated and trying to pass to Netsuite when it runs its query on the Netsuite side.
Despite trying this subtract to get our record numbers to match the automatic record numbers Celigo is assigning the records as a work-around, it is still erroring, though this time with a different error (the usual one about trying to access and modify a sublist item that may not exist).
What I don't understand is why Celigo is ignoring our mapping completely when we've set a specific mapping in the mappings (it's basically totally ignoring our mapping when we tell it what line IDs we want to associate with the records we're looking up).
Following is a Preview screenshot of the record output (pasted into VSCode for ease of reading with syntax highlighting).
One thing I noticed is that with the attempted subtract work-around is that it generates the line 0 field for the SKU MFGA01 line correctly, though then doesn't loop through the next line record and generate a revised line 1 value for SKU MFGA03 record, which it should.
Any idea why it wouldn't generate both line_ids?
The subtract 1 should have turned MFGA01 to line_id 0 and MFGA03 to line_id 1, as the original numbers were 1 and 2 respectively, yet it doesn't.
The input:
The output:
One thought. Whilst this flow has worked previously on a single record basis, should I be using "Items : LineID" or "Items : Line Number"?
To-date we've always used Line ID though thought maybe we can use Line Number instead?
Anyway, I'm going to raise a ticket with Celigo Support and will include this thread in the ticket so Support can get up to speed on it.
Regards,
Christian