Manage Custom Sales Objects

Oracle CX Sales and Fusion Service includes standard objects that account for many business needs and scenarios. You can, however, create custom objects whenever you have a unique business component for which you want to capture information in Oracle CX Sales and Fusion Service.

For examples and use cases of using custom objects, see Working with Custom Objects.

Creating Custom Objects in Oracle Application Composer

You can use the Application Composer tool to create custom top-level and child objects. It's a browser-based tool that business analysts, administrators, and programmers can use to configure Oracle CX Sales and Fusion Service. It's powerful: You can make data model changes that previously could only be made by application developers.

And it's quick: Because Application Composer is also a design-time runtime tool, you can navigate directly to it from Oracle CX Sales and Fusion Service, make your changes, and then instantly see them. To learn more, see the Extending Sales guide.

After creating a custom object, you can then use Application Composer to configure it further, including:
  • Set up security options
  • Specify how users can access the object
  • Add fields to capture required attributes
  • Display the object in a work area page, so that users can interact with the object records

To learn more, see the Extending Sales and Service guide.

Where are my Custom Objects?

Now that you've created a custom object, you'll need to find them to manage custom object resources, understand relationship between custom objects, and understand intersection objects.

Note:

The custom object and custom attributes are not displayed in the REST API resource unless the sandbox is published. For more information, see Publish Sandboxes.
To find the resource URIs for custom objects:
  1. Navigate to Application Composer.
  2. Click Custom Objects to view the list of custom objects in the Objects table.
  3. To view the URI for a specific object, in the REST Resource column, click the Service link that corresponds to that object. You can cut and paste the URI from the address bar of the browser.
  4. To view the description for a specific object, in the REST Resource column, click the Describe link that corresponds to that object.

Note that the URIs for a custom object and its description are the same, except that the custom object description URI ends with /describe. You can also derive child object URIs from the describe link of the parent object. For example:

.../YourRESTApi/resources/<api version>/<custom object>
.../YourRESTApi/resources/<api version>/<custom object>/describe
.../YourRESTApi/resources/<api version>/<custom object>/<identifier>/<custom child object>
.../YourRESTApi/resources/<api version>/<custom object>/<identifier>/<custom child object>/<describe>

Managing Custom Object Resources with REST APIs

Now that you know how to find your created objects, let's look at how you can interact with them using the REST API. For example, you can create, update, view, or delete records of a custom object by managing its corresponding resource through the REST API, just like you can with standard objects.

These custom object resources are managed just like standard objects:
  • Attribute LOVs
  • Attachments, including tasks and payloads
  • Notes, including tasks and payloads
  • Functions, at parent and child levels
Keep in mind:
  • Query parameters aren't supported for custom objects because custom saved searches aren't supported.
  • Custom object attachments must be created with content encoded in Base64.
  • To expose custom object functions created in Application Composer, set their visibility to Callable by External Systems. You can then call the exposed custom action with a POST request.
  • You must publish the sandbox with custom REST APIs before you can use the custom REST APIs. The REST API calls to an object in a sandbox are slow and result in poor performance.

Adding Custom Object Attributes

You can define custom attributes or fields on custom objects. Such added custom attributes are then managed through REST requests. The following example shows how you might add a custom attribute to a custom object resource.

Example

In the Application Composer, let's add the CustField_c custom attribute to the Product custom object resource. Here's the metadata before we add the custom attribute.

{
  "Resources" : {
    "Product_c" : {
      "discrColumnType" : false,
      "title" : "Product",
      "titlePlural" : "Product",
      "attributes" : [ {
        "name" : "Id",
        "type" : "integer",
        "updatable" : false,
        "mandatory" : true,
        "queryable" : true,
        "allowChanges" : "never",
        "precision" : 32,
        "title" : "Record ID",
        "properties" : {
          "fnd:FND_AUDIT_ATTR_ENABLED" : "false"
        }
      } 
    ... 
}

Here's the metadata after we add the custom attribute:

{
  "Resources" : {
    "Product_c" : {
      "discrColumnType" : false,
      "title" : "Product",
      "titlePlural" : "Product",
      "attributes" : [ {
        "name" : "Id",
        "type" : "integer",
        "updatable" : false,
        "mandatory" : true,
        "queryable" : true,
        "allowChanges" : "never",
        "precision" : 32,
        "title" : "Record ID",
        "properties" : {
          "fnd:FND_AUDIT_ATTR_ENABLED" : "false"
        }
      }
	  ...
	  {
        "name" : "CustField_c",
        "type" : "string",
        "updatable" : true,
        "mandatory" : true,
        "queryable" : true,
        "allowChanges" : "always",
        "precision" : 80,
        "title" : "Productrrf Name",
        "maxLength" : "80",
        "properties" : {
          "Indexed" : "Y",
          "fnd:OSN_ENABLED_ATTR" : "true",
          "TOOLTIP" : null,
          "description" : null,
          "DISPLAYWIDTH" : "30",
          "AttributeType" : "Text",
          "ExtnCustom" : "Y"
        }
      ...
}

Note:

All custom objects include the ConflictId attribute that is populated when a record is created. This is used to identify a record and to avoid creation of duplicate records.

Note:

You can use custom attributes to query ro filter records using the GET method. To query or filter records using a custom attribute, you must mark the custom attribute as Searchable in Application Composer.

To learn more, see the Getting Started with Extending Sales guide.

Relationships Between Custom Objects

Parent object resources expose the child objects of top-level custom objects. You can use the describe operation on a top-level custom object to return links to its child objects. You can find the URIs for child object resources from these child object links.

For objects to interact with one another, relationships must be created between them. The related objects can be either standard or custom objects. For example, if you want attributes from the Employee object to be available in the Trouble Ticket object workspace, a relationship must be defined between the Employee object and the Trouble Ticket object.

You can use Application Composer to create relationships between objects. Using Application Composer, you can create two types of relationships:
  • Parent-child: When you define a parent-child relationship, the link to the child object is included in the parent object description. A child object doesn't have its own workspace, and the child object's records are deleted if the parent object record is deleted.
  • Reference: When you define a reference relationship, the primary key of the source object is included as a foreign key in the description of the target object.

Intersection Objects

Use Application Composer to create many-to-many relationships between custom objects. In this case, you create an intersection object that references the source and target objects. For example, consider two object resources, Trouble Ticket and Resource, related by a many-to-many reference relationship, with the Assignment resource as the intersection object. In such a case, the following applies:
  • The Assignment resource has Trouble Ticket as the source object and Resources as the target object. The objects Trouble Ticket and Resources have many-to-many relationships.
  • The Assignment resource is the child resource of both Trouble Ticket and Resources.
When you retrieve a record from any of the parent objects, the intersection object is returned as a child object, with the foreign keys of the other related object included in the response body. For example, if the user requires the details of a resource, a GET call made on Trouble Ticket also includes the rows from the intersection object, Assignment, containing the foreign keys to the Resource object. This enhancement ensures that the customer has to make only two calls:
  • One call to the Trouble Ticket object to get all the Resources IDs.
  • One call to the Resource object to get additional details of each Resource.