Oracle Web Services On Demand Guide > Web Services On Demand API Calls > Web Services v2.0 API Calls >

Delete


Removes records of a specified record type from the Oracle CRM On Demand database.

Usage

You use the Delete method to remove one or more records of a particular object from an Oracle CRM On Demand instance.

The deleted records appear in the Deleted Items folder and can be restored through the Oracle CRM On Demand UI.

The Delete call can be used to delete both parent record and child records. If the child node specified in the request is available, it deletes the child in the existing parent record, and leaves the parent record undeleted. However, if the child node is missing, it deletes the existing parent record.

The AvailableForBatchRestore Argument

In Delete requests you can set the AvailableForBatchRestore argument to true and for record types that support batch delete and restore in the UI, you can then restore deleted records as a batch in the UI. When the request is executed, a batch delete record is created and displayed in the Batch Delete and Restore Queue page. Users with the Batch Delete and Restore privilege can then restore the records.

When the AvailableForBatchRestore argument is set to true, the Web services operation count is doubled for the request. This is because there is one operation for each deleted record and one operation due to the creation of a batch delete record.

When the AvailableForBatchRestore argument is set to false or not provided in the Delete request, a batch delete record is not created, and you cannot restore the deleted records as a batch in the Batch Delete and Restore Queue page. You can, however, still restore the deleted records individually in the UI.

For Delete requests containing a mixture of parent records and child records, only the records that support batch delete and restore in the UI are added to the queue. Separate batch delete records are created for each child record type. For child records, you can only use the AvailableForBatchRestore argument if the child record has a 1:M relationship with the parent record type. For example, deleted Account Lead records can be batch restored, because there is a 1:M relationship between leads and accounts.

NOTE:  If a child record does not have a 1:M relationship with the parent, or does not support batch delete and restore, the delete functionality still works but the batch delete record is not displayed in the Batch Delete and Restore Queue page, even if the argument is set to true.

For Delete requests that include some record types that do not support batch delete and restore, the AvailableForBatchRestore argument is ignored for those record types, but the request executes without error for records types that do support batch delete and restore.

For more information about restoration of batches of records in the UI, see Oracle CRM On Demand Online Help.

Arguments

Table 31 describes the arguments taken by the Delete method.

Table 31. Arguments Taken by the Delete Method
Name
Description
Required
Default
I/O

ListOf(Object). For example, ListOfAccount

The list of object instances to be deleted.

Yes

Not applicable

Input/Output

LOVLanguageMode

The language mode for picklists, see The LOVLanguageMode Argument.

No

LIC

Input

Echo

Controls whether data sent to Oracle CRM On Demand through integration Web services are recorded as transactions.

No

On

Input

ViewMode

Specifies the level of access to records specified in the method call, see The ViewMode Argument.

No

Broadest

Input

AvailableForBatchRestore

Controls whether the request will be available for batch restore in the Batch Delete and Restore Queue page in the UI.

No

False

Input

Return Value of the Call

The status key for each of the deleted objects.

Sample SOAP Request - Delete

The following SOAP request contains two contact records, one of which specifies a parent contact record and one of its child account records, while the other only specifies a parent contact record. When a child record is included in the request, the parent record is ignored and only the specified child record is deleted, whereas when no child record is included in the request, the parent record is deleted.

The contact ID is specified as the user key to identify the contact records in the request. See User Key Fields on the Contact Object for a list of valid user key field combinations for the contact object.

<?xml version="1.0" encoding="utf-8" standalone="no"?>

<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" xmlns:xsd="http://www.w3.org/2001/XMLSchema">

<soap:Header>

<wsse:Security>

<wsse:UsernameToken>

   <wsse:Username>%%USERNAME%%</wsse:Username>

   <wsse:Password Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordText">%%PASSWORD%%</wsse:Password>

</wsse:UsernameToken>

</wsse:Security>

</soap:Header>

<soap:Body>

<ContactDelete_Input xmlns="urn:crmondemand/ws/ecbs/contact/">

<ListOfContact>

   <Contact>

      <Id>ADSA-96IZCS</Id>

      <ListOfAccount>

         <Account>

            <AccountName>A1</AccountName>

            <AccountLocation>HQ</AccountLocation>

         </Account>

      </ListOfAccount>

   </Contact>

   <Contact>

      <Id>ADSA-96J5ZL</Id>

   </Contact>

</ListOfContact>

</ContactDelete_Input>

</soap:Body>

</soap:Envelope>

Sample SOAP Response

The following SOAP response contains the returned status keys for the deleted objects:

<?xml version="1.0" encoding="utf-8"?>

<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">

<SOAP-ENV:Body>

<ns:ContactDelete_Output xmlns:ns="urn:crmondemand/ws/ecbs/contact/">

<ListOfContact xmlns="urn:/crmondemand/xml/Contact/Data">

   <Contact>

      <ModifiedDate>2011-08-10T15:21:43Z</ModifiedDate>

      <CreatedDate>2011-08-09T21:17:05Z</CreatedDate>

      <ModifiedById>HRZ780-I5RUE</ModifiedById>

      <CreatedById>HRZ780-I5RUE</CreatedById>

      <ModId>4</ModId>

      <Id>ADSA-96IZCS</Id>

      <CreatedBy>Joanne Brown, 08/09/2011 16:17:05</CreatedBy>

      <ModifiedBy>Joanne Brown, 08/10/2011 10:21:43</ModifiedBy>

      <ListOfAccount>

         <Account>

            <ModifiedDate>2011-08-10T14:44:27Z</ModifiedDate>

            <CreatedDate>2011-08-10T14:44:27Z</CreatedDate>

            <ModifiedById>HRZ780-I5RUE</ModifiedById>

            <CreatedById>HRZ780-I5RUE</CreatedById>

            <ModId>0</ModId>

            <Id>ADSA-977GCL</Id>

            <CreatedBy>Joanne Brown, 08/10/2011 09:44:27</CreatedBy>

            <ModifiedBy>Joanne Brown, 08/10/2011 09:44:27</ModifiedBy>

         </Account>

      </ListOfAccount>

   </Contact>

   <Contact>

      <ModifiedDate>2011-08-10T15:22:46Z</ModifiedDate>

      <CreatedDate>2011-08-09T21:13:33Z</CreatedDate>

      <ModifiedById>HRZ780-I5RUE</ModifiedById>

      <CreatedById>HRZ780-I5RUE</CreatedById>

      <ModId>2</ModId>

      <Id>ADSA-96J5ZL</Id>

      <CreatedBy>Joanne Brown, 08/09/2011 16:13:33</CreatedBy>

      <ModifiedBy>Joanne Brown, 08/10/2011 10:22:46</ModifiedBy>

   </Contact>

</ListOfContact>

</ns:ContactDelete_Output>

</SOAP-ENV:Body>

</SOAP-ENV:Envelope>

Oracle Web Services On Demand Guide, Version 25.0 (Oracle CRM On Demand Release 37) Copyright © 2018, Oracle and/or its affiliates. All rights reserved. Legal Notices.