Deleting All Lines on a Sublist
This sample shows how to delete all addresses from the Address sublist on a customer record (CustomerAddressbookList).
Java
Customer update = new Customer();
update.setInternalId(c.getInternalId());
cabl = new CustomerAddressbookList();
cabl.setAddressbook(new CustomerAddressbook[0]);
cabl.setReplaceAll(true);
update.setAddressbookList(cabl);
SOAP
<update xmlns="urn:messages_2017_1.platform.webservices.netsuite.com">
<record internalId="724" xsi:type="ns1:Customer" xmlns:ns1="urn:relationships_2017_1.lists.webservices.netsuite.com">
<ns1:addressbookList replaceAll="true" xsi:type="ns1:CustomerAddressbookList"/>
</record>
</update>
The next sample shows how to delete all line items from the Item sublist (OpportunityItemList) on an opportunity record.
Java
Opportunity update = new Opportunity();
update.setInternalId(opp.getInternalId());
update.setItemList(new OpportunityItemList(new OpportunityItem[0], true));
SOAP
<update xmlns="urn:messages_2017_1.platform.webservices.netsuite.com">
<record internalId="6147" xsi:type="ns1:Opportunity" xmlns:ns1="urn:sales_2017_1.transactions.webservices.netsuite.com">
<ns1:itemList replaceAll="true" xsi:type="ns1:OpportunityItemList"/>
</record>
</update>