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.


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/"> 
    <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">

    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/">
          <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:LastUpdateLogin xsi:nil="true"/>
                <ns1:CpdrfVerSor xsi:nil="true"/>
                <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:Revenue_c xsi:nil="true"/>
  3. Validate that the object created through the web service appears in the Oracle Sales Cloud user interface.