This site contains the documentation that is relevant to older WSO2 product versions and offerings.
For the latest WSO2 documentation, visit https://wso2.com/documentation/.
Working with Delete in NetSuite
Overview
The following operations allow you to work with "delete". Click an operation name to see details on how to use it.
For a sample proxy service that illustrates how to work with "delete", see Sample configuration.
Operation | Description |
---|---|
Deletes a list. | |
detach | Detaches a record or file from another record. |
Operation details
This section provides details on the operations.
Deleting a list
The deleteList
operation is used to delete one or more existing instances of a certain record type in NetSuite. If there are multiple records, they can either be of the same record type or of different record types. For example, it's possible to delete a customer and a contact within a single request using this operation.
<netsuite.deleteList> <recordRef>{$ctx:recordRef}</recordRef> </netsuite.deleteList>
Properties
recordRef:
One or more records that need to be deleted. Must contain a reference to an existing instance of a record.
Sample request
Following is a sample SOAP request that can be handled by the deleteList operation.
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:urn="wso2.connector.netsuite.deletelist"> <soapenv:Header></soapenv:Header> <soapenv:Body> <urn:apiUrl>https://webservices.na1.netsuite.com/services/NetSuitePort_2014_1</urn:apiUrl> <urn:warningAsError></urn:warningAsError> <urn:disableMandatoryCustomFieldValidation></urn:disableMandatoryCustomFieldValidation> <urn:disableSystemNotesForCustomFields></urn:disableSystemNotesForCustomFields> <urn:ignoreReadOnlyFields></urn:ignoreReadOnlyFields> <urn:partnerId></urn:partnerId> <urn:applicationId></urn:applicationId> <urn:email>user@gmail.com</urn:email> <urn:password>123</urn:password> <urn:account>TVTDRV1193710</urn:account> <urn:roleInternalId></urn:roleInternalId> <urn:roleExternalId></urn:roleExternalId> <urn:roleType></urn:roleType> <urn:roleName></urn:roleName> <urn:recordRef> <RecordRef internalId="2857" type="customer" xsi:type="platformCore:RecordRef" xmlns:platformCore="urn:core_2014_1.platform.webservices.netsuite.com" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/> <RecordRef internalId="3451" type="customer" xsi:type="platformCore:RecordRef" xmlns:platformCore="urn:core_2014_1.platform.webservices.netsuite.com" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/> </urn:recordRef> </soapenv:Body> </soapenv:Envelope>
Detaching a file or record
The detach
operation removes a relationship between two records. For example, a Contact record can be associated with a Partner record, or an Opportunity record can be associated with a Customer record.
You can also use the detach
operation to detach a file from a record. Any file that is in the NetSuite file cabinet (such as a Microsoft Word or Excel file or a PDF) can be attached to any record other than a custom record.
- When attaching Contacts to other entity records, the Contact's role can also be specified during the request. Contact Roles are roles available in a user defined list at List > Relationships > Contacts. This list is exposed as ContactRole in
accounting.xsd
. - Contact records can be attached to all entity records except for other Contact or Group records.
<netsuite.detach> <detachReferece>{$ctx:detachReferece}</detachReferece> </netsuite.detach>
Properties
detachReference:
One or more records that need to be detached.
Sample request
Following is a sample SOAP request that can be handled by the detach operation.
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:urn="wso2.connector.netsuite.detach" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <soapenv:Header/> <soapenv:Body> <urn:apiUrl>https://webservices.na1.netsuite.com/services/NetSuitePort_2014_1</urn:apiUrl> <urn:warningAsError/> <urn:disableMandatoryCustomFieldValidation/> <urn:disableSystemNotesForCustomFields/> <urn:ignoreReadOnlyFields/> <urn:partnerId/> <urn:applicationId/> <urn:email>user@gmail.com</urn:email> <urn:password>123</urn:password> <urn:account>TVTDRV1193710</urn:account> <urn:roleInternalId/> <urn:roleExternalId/> <urn:roleType/> <urn:roleName/> <urn:detachReferece> <attachReferece xsi:type="ns1:AttachBasicReference" xmlns:ns1="urn:core_2014_1.platform.webservices.netsuite.com"> <ns1:attachTo internalId="1251" type="customer" xsi:type="ns1:RecordRef"> <ns1:name xsi:type="xsd:string">Acera</ns1:name> </ns1:attachTo> <ns1:attachedRecord internalId="961" type="contact" xsi:type="ns1:RecordRef"/> </attachReferece> </urn:detachReferece> </soapenv:Body> </soapenv:Envelope>
Sample configuration
Following is a sample proxy service that illustrates how to connect to NetSuite with the init
operation and use the deleteList operation. The sample request for this proxy can be found in deleteList sample request. You can use this sample as a template for using other operations in this category.
<?xml version="1.0" encoding="UTF-8"?> <proxy xmlns="http://ws.apache.org/ns/synapse" name="netsuite_deleteList" transports="https,http" statistics="disable" trace="disable" startOnLoad="true"> <target> <inSequence> <property xmlns:ns="wso2.connector.netsuite.deletelist" name="apiUrl" expression="//ns:apiUrl/text()"/> <property xmlns:ns="wso2.connector.netsuite.deletelist" name="warningAsError" expression="//ns:warningAsError/text()"/> <property xmlns:ns="wso2.connector.netsuite.deletelist" name="disableMandatoryCustomFieldValidation" expression="//ns:disableMandatoryCustomFieldValidation/text()"/> <property xmlns:ns="wso2.connector.netsuite.deletelist" name="disableSystemNotesForCustomFields" expression="//ns:disableSystemNotesForCustomFields/text()"/> <property xmlns:ns="wso2.connector.netsuite.deletelist" name="ignoreReadOnlyFields" expression="//ns:ignoreReadOnlyFields/text()"/> <property xmlns:ns="wso2.connector.netsuite.deletelist" name="partnerId" expression="//ns:partnerId/text()"/> <property xmlns:ns="wso2.connector.netsuite.deletelist" name="applicationId" expression="//ns:applicationId/text()"/> <property xmlns:ns="wso2.connector.netsuite.deletelist" name="email" expression="//ns:email/text()"/> <property xmlns:ns="wso2.connector.netsuite.deletelist" name="password" expression="//ns:password/text()"/> <property xmlns:ns="wso2.connector.netsuite.deletelist" name="account" expression="//ns:account/text()"/> <property xmlns:ns="wso2.connector.netsuite.deletelist" name="roleInternalId" expression="//ns:roleInternalId/text()"/> <property xmlns:ns="wso2.connector.netsuite.deletelist" name="roleExternalId" expression="//ns:roleExternalId/text()"/> <property xmlns:ns="wso2.connector.netsuite.deletelist" name="roleType" expression="//ns:roleType/text()"/> <property xmlns:ns="wso2.connector.netsuite.deletelist" name="roleName" expression="//ns:roleName/text()"/> <property xmlns:ns="wso2.connector.netsuite.deletelist" name="recordRef" expression="//ns:recordRef/*"/> <netsuite.init> <apiUrl>{$ctx:apiUrl}</apiUrl> <warningAsError>{$ctx:warningAsError}</warningAsError> <disableSystemNotesForCustomFields>{$ctx:disableSystemNotesForCustomFields}</disableSystemNotesForCustomFields> <ignoreReadOnlyFields>{$ctx:ignoreReadOnlyFields}</ignoreReadOnlyFields> <disableMandatoryCustomFieldValidation> {$ctx:disableMandatoryCustomFieldValidation} </disableMandatoryCustomFieldValidation> <roleInternalId>{$ctx:roleInternalId}</roleInternalId> <partnerId>{$ctx:partnerId}</partnerId> <applicationId>{$ctx:applicationId}</applicationId> <roleName>{$ctx:roleName}</roleName> <password>{$ctx:password}</password> <roleExternalId>{$ctx:roleExternalId}</roleExternalId> <email>{$ctx:email}</email> <account>{$ctx:account}</account> <roleType>{$ctx:roleType}</roleType> </netsuite.init> <netsuite.deleteList> <recordRef>{$ctx:recordRef}</recordRef> </netsuite.deleteList> <respond/> </inSequence> <outSequence> <send/> </outSequence> </target> <description/> </proxy>