I am trying to fulfill a Sales Order using SOAP web services. The first step in doing this is the initializeRecord operation
<initializeRecord xsi:type="urn1:InitializeRecord">
type xsi:type="xsd:string">itemFulfillment</type>
<reference internalId="27624" type="salesOrder" xsi:type="urn1:InitializeRef"/>
</initializeRecord>
However this returns an error code VALID_LINE_ITEM_REQD with message "You must have at least one valid line item for this transaction."
We do have multi location inventory enabled and I have seen some solutions suggesting to add default values for the location, however I don't see this option in the soap API. Is it missing or am I looking for the wrong thing? An example of code I have seen:
var recordObj = record.transform({
fromType : record.Type.SALES_ORDER,
fromId : soid,
toType : record.Type.ITEM_FULFILLMENT,
isDynamic:true,
defaultValues: {inventorylocation:103}
});
I have also tried to add the fulfillment using the addList operation skipping the initializeRecord step but got the same result.
I have tried fulfilling a copy of the order through the web UI and had no issues. On my original order, quantity is committed and inventoryLocation is selected on the line (so I don't see why I need a default inventoryLocation in the initialize record).
Another thing is that I am able to fulfill intercompany transfer orders with the same item from the same location using the SOAP webservice. It's only sales orders that can't be fulfilled.
Another note is that "allow cross sub fulfillments" is checked on the sales order. Not sure if this is affecting anything because I tried unchecking it and fulfilling with no change.
Is there anything else that could cause the line on the sales order referenced by the fulfillment being initialized to not be valid? Or is there any way to tell which validation failed?