I'm trying to transform a sales Order into Item Fu...
# suitescript
g
I'm trying to transform a sales Order into Item Fulfillment, I need to remove some item lines to the item fulfillment but I'm getting this error:
Copy code
type: "error.SuiteScriptError",
   name: "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."
This is the transform code:
var fulfillmentRecord = record.transform({
                        
fromType: record.Type.SALES_ORDER,
                        
fromId: salesOrderId,
                        
toType: record.Type.ITEM_FULFILLMENT,
                        
isDynamic: false
                    
});
And I'm trying to remove the lines like this:
fulfillmentRecord.removeLine({
                                
sublistId: 'item',
                                
line: x
                            
});
I want to remove the lines because the fulfillment will not include all the items on the sales order, so I need to remove the items that shouldn't be there. Does anyone have any idea what I'm doing wrong?
b
wrong type of sublist
you dont remove lines from a list type sublist like an item fulfillment
you can't do it in the ui, you cant do it in script
s
you probably don't need to remove the lines, just mark the ones you don't want as
itemreceive = false
or something like that.
g
Thanks for your help guys, I set the itemreceive as false and it works 🥳
👍 1