netsuitesuitetalk

NetSuite SuiteTalk Item Fulfillment Error - VALID_LINE_ITEM_REQD


Any suggestions are greatly appreciated!

The sales orders can have 50-100 lines. Each SO will have multiple item fulfillments. When we create the IF through SuiteTalk, we don't know which lines are already fulfilled or which lines are partially fulfilled.

When I create the soap, I am overriding the item list.

The code works fine if there is only 2 items on the sales order and all lines are being fulfilled.

The trouble arises when another process has added / deleted items on the sales order thus causing an order with 5 lines to have soLines such as 1, 45, 245, 300 & 301. If I am trying to fulfill line 245, I will receive VALID_LINE_ITEM_REQD.

Would anyone have suggestions on what needs to be initialized?

Thank you in advance,

Bill


Below is a sample request/response.

Request

<record xmlns:q1="urn:sales_2020_1.transactions.webservices.netsuite.com" xsi:type="q1:ItemFulfillment" externalId="mrk-so-2446425">
<q1:createdFrom internalId="2446425"/>
<q1:shippedDate>2020-12-25T06:00:00Z</q1:shippedDate>
<q1:shipStatus>_shipped</q1:shipStatus>
<q1:tranDate>2020-12-25T06:00:00Z</q1:tranDate>
<q1:generateIntegratedShipperLabel>false</q1:generateIntegratedShipperLabel>
<q1:itemList>
<q1:item>
<q1:location internalId="308"/>
<q1:quantity>1</q1:quantity>
<q1:item internalId="82198"/>
<q1:orderLine>101</q1:orderLine>
</q1:item>
</q1:itemList>
</record>

Response

<writeResponse>
<platformCore:status xmlns:platformCore="urn:core_2020_1.platform.webservices.netsuite.com" isSuccess="false">
<platformCore:statusDetail type="ERROR">
<platformCore:code>VALID_LINE_ITEM_REQD</platformCore:code>
<platformCore:message>You must have at least one valid line item for this transaction.</platformCore:message>
</platformCore:statusDetail>
</platformCore:status>
<baseRef xmlns:platformCore="urn:core_2020_1.platform.webservices.netsuite.com" type="itemFulfillment" xsi:type="platformCore:RecordRef" externalId="mrk-so-2446425"/>
</writeResponse>

Solution

  • Did you start your item fulfillment with an initialize call?

    ItemFulfillmentItem has a field 'orderLine'. This matches with the SalesOrderItem 'line' field.

    If what you actually want to fulfill can be calculated from the SO information then I just do a reverse loop through the fulfillment lines, using the orderLine value to key into the SalesOrder and remove any fulfillment lines that shouldn't be on this fulfillment.