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

Insert


Inserts a new record in the Oracle CRM On Demand database.

Usage

You use the Insert method to create one or more records of a particular object in an Oracle CRM On Demand instance.

When inserting a batch of records, the batch is treated as a single transaction. If one record fails to insert during a batch insertion, the entire operation is rolled back and no records are inserted.

The Insert method can be used to insert both parent records and child records. If a child node is specified in the request, the Insert method inserts the child and associates it with the existing parent record. If a child node is missing, the Insert call inserts only the new parent record.

Insert calls must include values for fields that are required for the object. Fields can be conditionally required, that is they become required if the data specified for other fields on the record meets the criteria defined in an expression for the field. For more information about conditionally-required fields, see Oracle CRM On Demand Online Help.

Arguments

Table 33 describes the arguments taken by the Insert method.

Table 33. Arguments Taken by the Insert Method
Name
Description
Required
Default
I/O

ListOf(Object). For example, ListOfAccount

The list of object instances to be inserted.

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

Return Value of the Call

The status key for each of the Oracle CRM On Demand objects.

Sample SOAP Request - Insert

The following SOAP request contains two contact records, one of which specifies a parent contact record and one of its child Account records, and the other only specifies a parent contact record. When a child record is included in the request, the parent record must exist in Oracle CRM On Demand and the child record specified is inserted and associated to the existing parent record. When no child record is included in the request, the parent record is inserted.

The ContactFirstName and ContactLastName are 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>

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

         <Echo>On</Echo>

         <LOVLanguageMode>LIC</LOVLanguageMode>

         <ListOfContact>

            <Contact>

               <ContactFirstName>NewCon2</ContactFirstName>

               <ContactLastName>Con2</ContactLastName>

               <ExternalSystemId>12345009</ExternalSystemId>

            </Contact>

            <Contact>

               <ContactFirstName>ExistingFirstName</ContactFirstName>

               <ContactLastName>ExistingLastName</ContactLastName>

               <ListOfAccount>

                  <Account>

                     <AccountName>Action Rentals</AccountName>

                  </Account>

               </ListOfAccount>

            </Contact>

         </ListOfContact>

       </ContactInsert_Input>

  </soap:Body>

</soap:Envelope>

Sample SOAP Response

The following SOAP response contains the returned status keys for the inserted 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:ContactInsert_Output xmlns:ns="urn:crmondemand/ws/ecbs/contact/">

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

            <Contact>

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

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

               <ModifiedById>HRZ780-I5RUE</ModifiedById>

               <CreatedById>HRZ780-I5RUE</CreatedById>

               <ModId>0</ModId>

               <Id>ADSA-977GCJ</Id>

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

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

            </Contact>

            <Contact>

               <ModifiedDate>2011-08-10T14:41:55Z</ModifiedDate>

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

               <ModifiedById>HRZ780-I5RUE</ModifiedById>

               <CreatedById>HRZ780-I5RUE</CreatedById>

               <ModId>2</ModId>

               <Id>ADSA-96IZCS</Id>

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

               <ModifiedBy>Joanne Brown, 08/10/2011 09:41:55</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>

         </ListOfContact>

      </ns:ContactInsert_Output>

   </SOAP-ENV:Body>

</SOAP-ENV:Envelope>

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