Inventory Detail

The inventory detail subrecord is available when the Advanced Bin / Numbered Inventory Management feature is enabled.

The inventory detail subrecord is defined in the Common XSD.

Important:

The SOAP web services code used to access bin number and serial/lot number data for items varies according to whether the Advanced Bin / Numbered Inventory Management feature is enabled. If this feature is not enabled, this data is available directly from the item, and you receive an error if you attempt to access it through the inventory detail record. If this feature is enabled, this data must be accessed through the inventory detail record. See Updating SOAP Web Services Code When Advanced Bin / Numbered Inventory Management is Enabled.

Operations Must Be in Parent Context

Any add, get, update, delete, or search operation on an inventory detail subrecord must be performed within the context of an operation on its parent record. For example, if you want to update inventory detail data for an item on a purchase order transaction, you must update the purchase order record itself; you cannot do an independent update of the inventory detail object. And this same limitation applies to all operations on an inventory detail subrecord.

Field Definitions

The SOAP Schema Browser includes definitions for all body fields, sublist fields, search filters, and search joins available to this subrecord. For details, see the SOAP Schema Browser’s inventory detail reference page

Note:

For information on using the SOAP Schema Browser, see SOAP Schema Browser.

Usage Notes

See the following sections for more details about this subrecord:

InventoryAssignmentList

In the schema, InventoryDetail includes a sublist called InventoryAssignmentList, with sublist fields that include the following: internalId, issueInventoryNumber, receiptnventoryNumber, binNumber, toBinNumber, quantity, expirationDate, and quantityAvailable.

Inventory Detail Preferences

The following preferences apply to inventory detail (and generally to all subrecords):

Sample Code

The following sections show a few examples of how to interact with the inventory details subrecord.

Setting Inventory Details on an Adjustment

The following examples illustrate setting inventory detail values on an inventory adjustment transaction.

Java

          InventoryAdjustment ia = new InventoryAdjustment();
ia.setSubsidiary(new RecordRef(null,"1",null,null));
ia.setAccount(new RecordRef(null,"1",null,null));
 
InventoryAdjustmentInventory item = new InventoryAdjustmentInventory();
item.setItem(new RecordRef(null, i.getInternalId(), null, null));
item.setLocation(new RecordRef(null,"1",null,null));
item.setAdjustQtyBy(new Double(2));
 
InventoryAssignment assign = new InventoryAssignment();
assign.setReceiptInventoryNumber("Grape19816143,Melon12289447");
assign.setQuantity(new Double(2));
 
InventoryDetail id = new InventoryDetail();
id.setInventoryAssignmentList(new InventoryAssignmentList(new InventoryAssignment[] {assign},true));
item.setInventoryDetail(id);
 
ia.setInventoryList(new InventoryAdjustmentInventoryList(new InventoryAdjustmentInventory[] {item},true));
 
sessMgr.getPort().add(ia); 

        

SOAP Request

          <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> 
      <soapenv:Body>
         <add xmlns="urn:messages_2017_1.platform.webservices.netsuite.com">
            <record externalId="Strawberry10424664" xsi:type="ns6:InventoryAdjustment" xmlns:ns6="urn:inventory_2017_1.transactions.webservices.netsuite.com">
               <ns6:subsidiary internalId="1" xsi:type="ns7:RecordRef" xmlns:ns7="urn:core_2017_1.platform.webservices.netsuite.com"/> 
               <ns6:account internalId="1" xsi:type="ns8:RecordRef" xmlns:ns8="urn:core_2017_1.platform.webservices.netsuite.com"/>
               <ns6:inventoryList replaceAll="true" xsi:type="ns6:InventoryAdjustmentInventoryList"> 
                  <ns6:inventory xsi:type="ns6:InventoryAdjustmentInventory">  
                     <ns6:item internalId="169" xsi:type="ns9:RecordRef" xmlns:ns9="urn:core_2017_1.platform.webservices.netsuite.com"/>
                     <ns6:inventoryDetail xsi:type="ns10:InventoryDetail" xmlns:ns10="urn:common_2017_1.platform.webservices.netsuite.com"> 
                        <ns10:inventoryAssignmentList replaceAll="true" xsi:type="ns10:InventoryAssignmentList">        
                           <ns10:inventoryAssignment xsi:type="ns10:InventoryAssignment">
                              <ns10:receiptInventoryNumber xsi:type="xsd:string">Grape19816143,Melon12289447</ns10:receiptInventoryNumber>
                              <ns10:quantity xsi:type="xsd:double">2.0</ns10:quantity>
                           </ns10:inventoryAssignment> 
                        </ns10:inventoryAssignmentList>
                     </ns6:inventoryDetail>
                     <ns6:location internalId="1" xsi:type="ns11:RecordRef" xmlns:ns11="urn:core_2017_1.platform.webservices.netsuite.com"/> 
                     <ns6:adjustQtyBy xsi:type="xsd:double">2.0</ns6:adjustQtyBy>
                  </ns6:inventory> 
               </ns6:inventoryList>
            </record>
         </add>
      </soapenv:Body>
   </soapenv:Envelope> 

        

SOAP Response

          <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
      <soapenv:Header>
         <platformMsgs:documentInfo xmlns:platformMsgs="urn:messages_2017_1.platform.webservices.netsuite.com">
            <platformMsgs:nsId>WEBSERVICES_1247336_092920111272224852700968262_b9abc599312e</platformMsgs:nsId>
         </platformMsgs:documentInfo>
      </soapenv:Header>
      <soapenv:Body>
         <addResponse xmlns="urn:messages_2017_1.platform.webservices.netsuite.com">
            <writeResponse>
               <platformCore:status isSuccess="true" xmlns:platformCore="urn:core_2017_1.platform.webservices.netsuite.com"/>
               <baseRef internalId="76" externalId="Strawberry10424664" type="inventoryAdjustment" xsi:type="platformCore:RecordRef" xmlns:platformCore="urn:core_2017_1.platform.webservices.netsuite.com"/>
            </writeResponse>
         </addResponse>
      </soapenv:Body>
   </soapenv:Envelope> 

        

Searching by Inventory or Bin Number

The following examples illustrate how to search using inventory number or bin number.

With the first approach shown below, you search using the internal ID of the inventory number. (An inventory number is a serial number or a lot number.) In response, the system looks for item records that reference this number. For each occurrence found, the system returns the data available in the Inventory Detail pop-up. Note that these details may be associated with a variety of other records, such as sales orders, inventory adjustments, and so on. This data includes the serial/lot number, the quantity and, if applicable, the bin number.

SOAP Request for Search by Inventory Number

          <search xmlns="urn:messages_2017_1.platform.webservices.netsuite.com">
            <searchRecord xsi:type="ns7:ItemSearchAdvanced" xmlns:ns7="urn:accounting_2017_1.lists.webservices.netsuite.com">
               <ns7:criteria xsi:type="ns7:ItemSearch">
                  <ns7:inventoryDetailJoin xsi:type="ns8:InventoryDetailSearchBasic" xmlns:ns8="urn:common_2017_1.platform.webservices.netsuite.com">
                     <ns8:inventoryNumber operator="anyOf" xsi:type="ns9:SearchMultiSelectField" xmlns:ns9="urn:core_2017_1.platform.webservices.netsuite.com">
                        <ns9:searchValue internalId="143" type="inventoryNumber" xsi:type="ns9:RecordRef"/>
                     </ns8:inventoryNumber>
                  </ns7:inventoryDetailJoin>
               </ns7:criteria>
               <ns7:columns xsi:type="ns7:ItemSearchRow">
                  <ns7:inventoryDetailJoin xsi:type="ns10:InventoryDetailSearchRowBasic" xmlns:ns10="urn:common_2017_1.platform.webservices.netsuite.com">
                     <ns10:binNumber xsi:type="ns11:SearchColumnSelectField" xmlns:ns11="urn:core_2017_1.platform.webservices.netsuite.com"/>
                     <ns10:internalId xsi:type="ns12:SearchColumnSelectField" xmlns:ns12="urn:core_2017_1.platform.webservices.netsuite.com"/>
                     <ns10:inventoryNumber xsi:type="ns13:SearchColumnSelectField" xmlns:ns13="urn:core_2017_1.platform.webservices.netsuite.com"/>
                     <ns10:quantity xsi:type="ns14:SearchColumnDoubleField" xmlns:ns14="urn:core_2017_1.platform.webservices.netsuite.com"/>
                  </ns7:inventoryDetailJoin>
               </ns7:columns>
            </searchRecord>
         </search> 

        

The following example is similar to the preceding one. However, in this example, you search using the internal ID of the bin number. Similar to the previous example, this search looks for item records, this time looking for those whose inventory details reference the bin number identified in your search. Again, these details may be associated with a variety of records. The data returned includes the serial/lot number, the quantity and the bin number.

SOAP Request for Search by Bin Number

          <search xmlns="urn:messages_2017_1.platform.webservices.netsuite.com">
            <searchRecord xsi:type="ns7:ItemSearchAdvanced" xmlns:ns7="urn:accounting_2017_1.lists.webservices.netsuite.com">
               <ns7:criteria xsi:type="ns7:ItemSearch">
                  <ns7:inventoryDetailJoin xsi:type="ns8:InventoryDetailSearchBasic" xmlns:ns8="urn:common_2017_1.platform.webservices.netsuite.com">
                     <ns8:binNumber operator="anyOf" xsi:type="ns9:SearchMultiSelectField" xmlns:ns9="urn:core_2017_1.platform.webservices.netsuite.com">
                        <ns9:searchValue internalId="1" type="bin" xsi:type="ns9:RecordRef"/>
                     </ns8:binNumber> 
                  </ns7:inventoryDetailJoin>
               </ns7:criteria>
               <ns7:columns xsi:type="ns7:ItemSearchRow">
                  <ns7:inventoryDetailJoin xsi:type="ns10:InventoryDetailSearchRowBasic" xmlns:ns10="urn:common_2017_1.platform.webservices.netsuite.com">
                     <ns10:binNumber xsi:type="ns11:SearchColumnSelectField" xmlns:ns11="urn:core_2017_1.platform.webservices.netsuite.com"/>
                     <ns10:internalId xsi:type="ns12:SearchColumnSelectField" xmlns:ns12="urn:core_2017_1.platform.webservices.netsuite.com"/>
                     <ns10:inventoryNumber xsi:type="ns13:SearchColumnSelectField" xmlns:ns13="urn:core_2017_1.platform.webservices.netsuite.com"/>
                     <ns10:quantity xsi:type="ns14:SearchColumnDoubleField" xmlns:ns14="urn:core_2017_1.platform.webservices.netsuite.com"/>
                  </ns7:inventoryDetailJoin>
               </ns7:columns>
            </searchRecord>
         </search> 

        

Related Topics

Items
Transactions
Subrecords
Updating SOAP Web Services Code When Advanced Bin / Numbered Inventory Management is Enabled
Advanced Bin / Numbered Inventory Management
How to Use the SOAP Web Services Records Help
SOAP Web Services Supported Records
SOAP Schema Browser
SuiteTalk SOAP Web Services Platform Overview

General Notices