Hi all! Maybe anyone faced the same. When transfor...
# suitescript
d
Hi all! Maybe anyone faced the same. When transforming a Sales Order into Item Fulfillment I get the following error:
Copy code
var itemFulFillment = record.transform({
                fromType: 'salesorder',
                fromId: salesOrderId,
                toType: 'itemfulfillment',
                isDynamic: true

            })
Error:
Copy code
{"type":"error.SuiteScriptError","name":"VALID_LINE_ITEM_REQD","message":"You must have at least one valid line item for this transaction."
When fulfill this SO manually, ItemFulfillment is created with lines
c
It's usually the defaults. Do a search for VALID_LINE_ITEM_REQD on this Slack, and follow the advice given in all of the threads
a
var transformed = record.transform({
                   
fromType: 'salesorder',
                   
fromId: soId,
                   
toType: 'itemfulfillment',
                   
defaultValues: { inventorylocation: 5 }
               
})
👍 1
adding default location value works fine with me
d
Yep, thank you, it was the root cause indeed!