Cloud Documentation
Advanced Search


Use Cases for Implementing Applications for Oracle Sales Cloud
Close Window

Table of Contents

Show All | Collapse

5 Working with Custom Object Web Services

This section provides illustrative guidance for manipulating custom objects and parent-child custom objects using Oracle Sales Cloud web services.

Topics:

Manipulating Custom Objects Using Oracle Sales Cloud Web Services

The following scenario outlines the steps necessary to create a custom object External Quote and relate it to the standard object Opportunity (for the purpose of Oracle Sales Cloud). Quote objects are created through web service calls from a third-party application.

This section contains the following tasks for manipulating custom objects using Oracle Sales Cloud web services:

Task 1   Prerequisites

To create the custom object, you will need to work outside of a sandbox. This prerequisite is necessary for successful web service interaction.

Task 2   Create the Custom Object

To create the custom object:

  1. In the Application Composer, from the Application list, select Sales.

  2. Once you have selected to create a custom object, edit the fields as required in the Create Custom Object dialog.

    Create Custom Object dialog contains Display Label, Plural Label, Record Name Label, Record Name Data Type, Sequence Format, Object Name, and Description fields.
  3. Click the Create a custom field icon.

  4. Add the following fields:

    Field Display Label Type

    QuoteId

    Quote Id

    Text

    QuoteNr

    Quote Nr

    Text

    Description

    Description

    Text

    Status

    Status

    Text

    Revenue

    Revenue

    Currency

    Primary

    Primary

    Checkbox


    An example of what fields and options will appear in the Create Text Field dialog is shown in the following figure:

    Create Text Field contains Appearance, Name, Constraints, and Default Value sections.

    The resulting fields created are listed in the Custom tab of the Fields dialog. Metadata fields are automatically created and can be accessed in the Standard tab.

Task 3   Create the Relationship with Opportunity

To create the relationship with opportunity:

  1. In the Application Composer, from the Actions list, select Create.

  2. Edit the fields as required in the Create Relationship dialog.

    Create Relationship dialog contains Source Object, Target Object, Name, and Description fields.
Task 4   Add a Tab to the Opportunity Details for Processing of Quote

Before adding a tab to the opportunity details for processing Quote, it is recommended that you already be in an active sandbox.

Create Sandbox dialog contains Sandbox Name and Description fields, as well as a "Create data security sandbox check" box.
  1. In the Application Composer, from the Objects navigation bar, click Opportunity > Pages

  2. Under the Opportunity Detail Tab section, click the Create icon. The Create Subtab dialog appears.

  3. Navigate the Create Subtab then Create Subtab: Child or Related Object dialogs. When you have verified the object parameters, click Save and Close.

Task 5   Test the User Interface

To test the object created above in the user interface, login as salesadmin and use the same sandbox in the procedure above. Verify that the newly created information for the Quote tab appears and it contains the required data.

Task 6   Create a New External Quote by using Web Services

The following procedure outlines how to create a new external quote using web services.

Use the information in the OptyId field displayed above.

  1. In Application Composer, create a Request under the SalesCustomObjectService list.

  2. The Request sample code is as follows:

    <S:Envelope xmlns:S="http://schemas.xmlsoap.org/soap/envelope/"> 
    <S:Body> 
    <ns5:createEntity xmlns:ns2="http://xmlns.oracle.com/adf/svc/types/" xmlns:ns3="http://xmlns.oracle.com/adf/svc/errors/" xmlns:ns4="commonj.sdo" xmlns:ns5="http://xmlns.oracle.com/apps/sales/custExtn/extnService/types/" xmlns:ns6="/oracle/apps/sales/custExtn/views/common/">
             <ns5:object xsi:type="ns6:Quote_c" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
                <ns6:RecordName>EQ1</ns6:RecordName>
                <ns6:QuoteId_c>1</ns6:QuoteId_c>
                <ns6:QuoteNr_c>1</ns6:QuoteNr_c>
                <ns6:Description_c>SimpleQuote</ns6:Description_c>
                <ns6:Status_c>Open</ns6:Status_c>
    <ns6:Opportunity_Id_Opty2Quote>300000001038150</ns6:Opportunity_Id_Opty2Quote>
         </ns5:object>
             <ns5:objectName>Quote_c</ns5:objectName>
          </ns5:createEntity>
       </S:Body>
    </S:Envelope>
    

    The Name field in the Create Relationship dialog shows the value Opty2Quote.

    The response sample code reads as follows:

    <env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/" xmlns:typ="http://xmlns.oracle.com/apps/sales/custExtn/extnService/types/">
       <env:Header/>
       <env:Body>
          <ns0:createEntityResponse xmlns:ns0="http://xmlns.oracle.com/apps/sales/custExtn/extnService/types/">
             <ns2:result xsi:type="ns1:Quote_c" xmlns:ns2="http://xmlns.oracle.com/apps/sales/custExtn/extnService/types/" xmlns:ns1="/oracle/apps/sales/custExtn/views/common/" xmlns:ns0="http://xmlns.oracle.com/adf/svc/types/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
                <ns1:Id>300000001038356</ns1:Id>
                <ns1:RecordName>000002</ns1:RecordName>
                <ns1:CreatedBy><username></ns1:CreatedBy>
                <ns1:CreationDate>2012-08-31</ns1:CreationDate>
                <ns1:LastUpdatedBy><username></ns1:LastUpdatedBy>
                <ns1:LastUpdateDate>2012-08-31</ns1:LastUpdateDate>
                <ns1:ObjectVersionNumber>1</ns1:ObjectVersionNumber>
                <ns1:LastUpdateLogin xsi:nil="true"/>
                <ns1:CpdrfVerSor xsi:nil="true"/>
                <ns1:ConflictId>0</ns1:ConflictId>
                <ns1:UserLastUpdateDate xsi:nil="true"/>
                <ns1:CpdrfLastUpd xsi:nil="true"/>
                <ns1:CpdrfVerPillar xsi:nil="true"/>
                <ns1:JobDefinitionPackage xsi:nil="true"/>
                <ns1:RequestId xsi:nil="true"/>
                <ns1:JobDefinitionName xsi:nil="true"/>
                <ns1:CurrencyCode>USD</ns1:CurrencyCode>
                <ns1:CurcyConvRateType>Corporate</ns1:CurcyConvRateType>
                <ns1:CorpCurrencyCode>USD</ns1:CorpCurrencyCode>
                <ns1:SourceType>Quote_C</ns1:SourceType>
                <ns1:AttachmentEntityName>Quote_c</ns1:AttachmentEntityName>
                <ns1:PKProxy>300000001038356</ns1:PKProxy>
                <ns1:IsOwner>true</ns1:IsOwner>
                <ns1:QuoteId_c>1</ns1:QuoteId_c>
                <ns1:QuoteNr_c>1</ns1:QuoteNr_c>
                <ns1:Description_c>SimpleQuote</ns1:Description_c>
                <ns1:Status_c>Open</ns1:Status_c>
                <ns1:Revenue_c xsi:nil="true"/>
                <ns1:Revenue_cCurrencyCode>USD</ns1:Revenue_cCurrencyCode>
                <ns1:Revenue_cCurcyConvRate>1</ns1:Revenue_cCurcyConvRate>
                <ns1:Primary_c>true</ns1:Primary_c>
                <ns1:Opportunity_Id_Opty2Quote>300000001038150</ns1:Opportunity_Id_Opty2Quote>
             </ns2:result>
          </ns0:createEntityResponse>
       </env:Body>
    </env:Envelope>
    
  3. Validate that the object created through the web service appears in the Oracle Sales Cloud user interface.