merge Operation

The merge operation performs an upsert, which means that the operation updates a service data object if it exists, or creates a new service data object if it doesn't exist.

The upsert behavior of the operation applies to all levels of the service data object. For example, to add a new child entity to an existing top-level entity, you must use the merge operation. You can't use the create and update operations defined at the top-level entity because the create operation creates only an entire new object, and the update operation updates only existing rows in an object.

Operation Signature

For the Sales Lead service, the following is the mergeSalesLead operation that accepts the object to be created or updated.

<element name="mergeSalesLead">
    <complexType>
        <sequence>
            <element name="salesLead" type="ns1:MklLead"/>
        </sequence>
    </complexType>
</element>

The response payload returns the newly created or updated object after the operation completes successfully.

<element name="mergeSalesLeadResponse">
    <complexType>
        <sequence>
            <element name="result" type="ns1:MklLead"/>
        </sequence>
    </complexType>
</element>

Example

This example request payload updates the status of the Sales Lead business object by changing the StatusCode attribute to QUALIFIED. The internal identifier of the object is 300100041938883.

<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
    <soap:Body>
        <ns1:mergeSalesLead
 xmlns:ns1="http://xmlns.oracle.com/apps/marketing/leadMgmt/leads/leadService/types/">
        <ns1:salesLead
xmlns:ns2="http://xmlns.oracle.com/oracle/apps/marketing/leadMgmt/leads/leadService/">
                <ns2:StatusCode>QUALIFIED</ns2:StatusCode>
                <ns2:LeadId>300100041938883</ns2:LeadId>
            </ns1:salesLead>
        </ns1:mergeSalesLead>
    </soap:Body>
</soap:Envelope>

The response payload contains information about the updated Sales Lead object.

Related Operations

To merge large business objects or to merge objects for which the response payload is not required, use the process operation. This operation performs the merge and controls whether the response payload is empty, contains only the primary key, or contains the entire payload.

Depending on the scenario, use create and delete operations instead of the merge operation.

Related Topics
  • Standard CRUD Operations
  • create Operation
  • delete Operation
  • get Operation
  • find Operation
  • find by additional predefined search criteria Operation
  • update Operation
  • process Operation