Sublists in SOAP Web Services
Most records in NetSuite include sublists, which generally contain a list of references to other records. This figure shows the Expenses sublist on the check record. Notice that this sublist includes two lines in the Expenses sublist.
For general information on sublists in NetSuite, see Record Subtabs
![The Expenses sublist in the UI.](img/SuiteCloudCustomizationScriptingWebServices/SuiteTalkWebServices/ExpensesSublist.png)
In SOAP web services, sublists are represented in a record's schema definition by its List elements.
Except for the customFieldList element (which contains a record's custom fields), all other elements that end in List represent a record's sublists.
The following is a portion of the schema for the Check record. (Although the XSD shown below describes the Items sublist on the check record, the same pattern for defining sublists applies to all sublists on all records.)
Notice that the sublists on the check record include the Expenses sublist, the Items sublist, and the Landed Costs sublist (not shown in the figure above because the Landed Costs feature is not enabled in the account).
<complexType name="Check">
<complexContent>
<extension base="platformCore:Record">
<sequence>
<element name="createdDate" type="xsd:dateTime" minOccurs="0"/>
<element name="address" type="xsd:string" minOccurs="0"/>
<element name="subsidiary" type="platformCore:RecordRef" minOccurs="0"/>
........
<element name=" expenseList " type="tranBank:CheckExpenseList" minOccurs="0"/>
<element name=" itemList " type="tranBank:CheckItemList" minOccurs="0"/>
<element name=" landedCostsList " type="tranBank:CheckLandedCostList" minOccurs="0"/>
<element name="billPay" type="xsd:boolean" minOccurs="0"/>
<element name="customFieldList" type="platformCore:CustomFieldList" minOccurs="0"/>
</sequence>
</extension>
</complexContent>
</complexType>
The itemList element (listed above) is of type CheckItemList, which is defined in the CheckItem complex type (defined in transactions.bank.xsd). The CheckItem type (shown below) includes all the properties that can be set for the Item sublist on the check record. Also notice the replaceAll attribute in CheckItemList. You will set the value of replaceAll to true or false depending on whether you are working with keyed sublists or non-keyed sublists. See Updating Sublists in SOAP Web Services for details.
<complexType name=" CheckItem ">
<sequence>
<element name="item" type="platformCore:RecordRef" minOccurs="0"/>
<element name="vendorName" type="xsd:string" minOccurs="0"/>
....
<element name="line" type="xsd:long" minOccurs="0"/>
<element name="location" type="platformCore:RecordRef" minOccurs="0"/>
<element name="isBillable" type="xsd:boolean" minOccurs="0"/>
<element name="customFieldList" type="platformCore:CustomFieldList" minOccurs="0"/>
</sequence>
</complexType>
<complexType name=" CheckItemList ">
<sequence>
<element name="item" type="tranBank:CheckItem" minOccurs="0" maxOccurs="unbounded"/>
</sequence>
<attribute name=" replaceAll " type="xsd:boolean" default="true"/>
</complexType>