Hi all,
In one of our Suitelets, we call nlapiTransformRecord from Sales Order to Item Fulfillment for a Service Item.
The nlapiTransformRecord throws "Error Code: VALID_LINE_ITEM_REQD Details: You must have at least one valid line item for this transaction."
Did some research and found in SuiteAnswers
https://netsuite.custhelp.com/app/answers/detail/a_id/79019/kw/VALID_LINE_ITEM_REQD
Answer Id: 79019
Transforming a Sales Order to a Cross-Subsidiary Item Fulfillment Record will return a "VALID_LINE_ITEM_REQD > You must have at least one valid line item for this transaction" error if we did not specify an inventoryLocation in the defaultValue parameter.
Here is a sample SuiteScript in 2.0:
function createIF(soId, invLocation) {
var itemFulfillment = record.transform({
fromType: record.Type.SALES_ORDER,
fromId: soId,
toType: record.Type.ITEM_FULFILLMENT,
defaultValues: {
inventorylocation: invLocation
}
});
/**
* You can insert other script logic here
*/
var ifID = itemFulfillment.save();
return ifID;
}
The Inventory Location is the Internal ID of the Location.
Tried with different locations e.g.
nlapiTransformRecord('salesorder', 5280047, 'itemfulfillment', {'inventorylocation' : '4'});
but still same error.
What am I missing here?
Can someone please help.
Thanks,
Rajesh