``` if(itemType == "Kit/Package...
# suitescript
c
Copy code
if(itemType == "Kit/Package") {
                        var lineItem = newRec.setSublistValue({
                            sublistId: 'item',
                            fieldId: 'location',
                            line: i,
                            value: itemLoc
                        });

                        
                        log.debug({
                            title: 'Item Test',
                            details: "line: "+i+" || type: "+itemType+" || location is: "+itemLoc
                        });
                    }
Any ideas why my
setSublistValue
is not working? The log works so, it's definitely not the itemType condition.
b
not really enough information
c
@battk I'm not sure what I could give you, I'm trying to override the location in the item sublist for kit/package items for webstore orders
b
more of the script
what you gave is not enough
e
You're trying to change a value in an afterSubmit. You can't use newRec.setSublistValue. You need to load the record using record.load and then set the value, then save with record.save()
c
@ericbirdsall I had a hunch that it was the way how I was trying to do it tysm!