I fulfilled a test sales order using the line id o...
# suitescript
a
I fulfilled a test sales order using the line id of sales order lines. I attempted the same with a transfer order but am receiving "Failed to create, update/transform record because You have attempted an invalid sublist or line item operation." errors. Are there different ways to scripts these, or did I get lucky with the Sales Order?
b
what does the code look like
a
I've messed with it 18 ways, but currently. Without this. the entire Transfer Order is fulfilled. Itemkey = internal id of item
Copy code
"nlobjSublistIds": {
    "item": {
      "lines": [
        {
          "itemkey": 5745,
          "quantity": 1
        },
        {
          "itemkey": 1324,
          "quantity": 1
        }
      ]
    }
  }
m
Are you trying this in integrator.io?
a
@michoel correct. no issues with item receipts, but item fulfillments are being an absolute pain.
m
Try posting in #CFG7DNCM9 and mention it's integrator.io
b
in general you need to map a key, ideally orderline
if you dont, it tries to add an item, which will fail since thats not a thing that can be done in item fulfillments
item can be used as a last resort, but it basically means you arent allowed to use duplicate items on different rows anymore
a
@battk On the Sales Order, I have 'line' and 'lineuniquekey'. No orderline.
b
the orderline is a field on the item fulfillment that matches the line field on the sales order
or the transfer order if the fulfillment is for a transfer order
a
I see what you are saying. orderline on the fulfillment == line id of the sales order. Sadly, I am using Celigo and orderline doesn't appear to be something I can map with.
b
you can map any field you want using jsonpaths
for example orderline would be
Copy code
item[*].orderline
you also want to take a look at the error details, celigo shares the code it uses to try and create your fulfillment and thats what you need to debug
a
Copy code
{
  "code": "SSS_INVALID_SUBLIST_OPERATION",
  "message": "You have attempted an invalid sublist or line item operation. You are either trying to access a field on a non-existent line or you are trying to add or remove lines from a static sublist."
}
importing record { "index": 0, "retryCount": 0 }
{ "nlobjRecordType": "itemfulfillment", "nlobjFieldIds": { "celigo_nlobjTransformId": 5399375, "celigo_recordmode_dynamic": "true", "shipstatus": "C", "celigo_replaceAllLines_package": "true", "internalid": "" }, "nlobjSublistIds": { "item": [{ "orderline": 1, "quantity": 1, "itemreceive": true }, { "orderline": 2, "quantity": 2, "itemreceive": true }], "package": [{ "packagetrackingnumber": "111111111111", "packageweight": 6.5 }] } }
nlapi calls registered for $R:
r = NRecord.transform({ "fromType": "salesorder", "fromId": 5399375, "toType": "itemfulfillment", "defaultValues": { "recordmode": "dynamic" } });
r.setValue({ "fieldId": "shipstatus", "value": "C" });
even at its bare minimums. this problem is really throwing me for a loop.
b
there are 2 problems with the stuff you shared
first its not matching any of the keys fields, so you have no lines
also you are getting an error about messing with a sublist, which the code doesnt do
which suggests something else like a user event script
first error suggests that you need to go back to the sales order and examine the line fields, dont make the make of assuming that the line field is the same as the line sequence number
second one requires you to look at scripts or less likely workflows from Scripted Records
a
I have these two, but no line sequence number on the SO.
b
line sequence refers to the actual ordering of lines, first line is 1 and second is 2 and so on
a
No scripted records outside of NetSuite Platform Solutions Group on the IF record.
b
you can also use the line number for a mapping, though it tends to be useless in partial fulfillments
whatever script is deployed on your item fulfillment is the first one you want to check for problems
or disable for quickness
a
{
"nlobjFieldIds": { "celigo_nlobjTransformId": 5399375, "celigo_recordmode_dynamic": "true", "shipstatus": "C" }, "nlobjSublistIds": { "item": { "lines": [ { "itemkey": 11712, "orderline": "1", "itemreceive": "true", "quantity": 1, "_keys": [ "orderline" ] }, { "itemkey": 11987, "orderline": "2", "itemreceive": "true", "quantity": 2, "_keys": [ "orderline" ] } ] } } }
That look more like what you'd expect?
Also inactivated the 5 scripts on the IF. No change. (drag and drop and a few other NS ones)
b
the object that netsuite generates doesnt really matter
its the code that the error details give you that is valuable
a
I finally figured it out. Setting an IF Status Internal ID of "C" would throw invalid sublist. Switched to Status (Name) of "Shipped", and no error. I have literally no idea why...