Transform sales order to item fulfillment

For a sales order with committed line items can be converted by setting default value as inventory location. Kindly refer to the transform code below.

let trecord = record.transform({
fromType: “salesorder”,
fromId: salesOrderId,
toType: “itemfulfillment”,
defaultValues: { ‘inventorylocation’: locationInternalId }
});

If the sales order is uncommitted and the feature “Allow uncommitted” is enabled in the account can fulfill the uncommitted sales order. In this case use below code without using the default value

let trecord = record.transform({
fromType: “salesorder”,
fromId: salesOrderId,
toType: “itemfulfillment”,
});

Leave a comment

Your email address will not be published. Required fields are marked *