Define Objects

Using Application Composer, modify an application's object model so that you can track and store any additional data you might need. For example, add new fields to an existing object (standard objects), or create entirely new objects (custom objects).

Standard objects are objects that are delivered with an application, and made available to Application Composer for application changes. Custom objects are objects that you create using Application Composer. You can create either top-level objects (objects without a parent) or child objects (objects created in the context of a parent).

Read this topic to learn about these tasks:

  • Browsing the object tree

  • Creating a custom object

  • Deleting a custom object

  • Using the Object Overview page

  • Editing an object's attributes

  • Selecting the display icon for the object's set of UI pages

  • Viewing child and related objects

Use Application Composer's Object Tree

Access Application Composer from the Navigator menu. The first view of Application Composer is the main Overview page, which is the entry point into all your application change options.

On the main Overview page, the regional pane at left displays the object tree, which lets you browse an application's existing object configuration in a tree format. The object tree reflects the latest configuration of the application: both standard objects as well as custom objects.

To use the object tree:

  1. Select Application Composer from the Navigator menu, under the Configuration category.

  2. For each object node, whether standard or custom, expand it further to view and edit object details.

    For example, look at object details such as fields and UI pages where the object is exposed.

    Note: At the top of the object tree, you can also click the New icon to create a new custom object.

    For both standard and custom objects, you can view and edit the following details:

    • Fields

      Add new fields to an object.

    • Pages

      Modify the pages on which an object appears.

    • Actions and links

      Add actions or links to pages.

    • Server scripts

      Write application logic that controls the behavior of an object's records.

    For custom objects, you can also view and edit details to security. For example, you can implement functional and data-level security for an object and its records.

Create a Custom Object

Create a custom object if you want to track data about an object that's not already delivered with your cloud service. After you create the object, you then add custom fields and design user interface pages where your users can enter object records. There's no fixed limit on the number of custom objects that you can create.

To create a custom object:

  1. On the main Overview page of Application Composer, select the Custom Objects node in the object tree, or click the icon in the local area of the main Overview page.

  2. On the resulting summary table, click the New icon, or at the top of the object tree, click the New icon.

  3. Complete the primary identifying attributes for a custom object:

    1. Display Label

      An object's display label is the user-friendly label for an object, and also becomes the default page title for the object's work area.

    2. Plural Label

      The plural label is used as the title of the object's work area. The label is also used as the search string in the regional search, as well as in the saved search on the object's runtime overview page.

    3. Record Name Label

      Use the Record Name Label field to specify the display label for the object's RecordName attribute. The RecordName attribute stores the user-entered "name" of the record. For example, if you're creating a custom object, Book. In the Record Name Label field for this object, you would enter something like "ISBN Number." At runtime, for each new record, your users would use the ISBN Number field to enter the book's International Standard Book Number (ISBN), which uniquely identifies books published internationally.

      Typically, this field is the object's primary user-recognizable identifier that runtime users drill down on, from the landing page to the detail page. For example, at runtime, your users would click any ISBN to drill down to review details about the book, such as book title and author.

    4. Record Name Data Type

      Select either Text or Automatically Generated Sequence.

      For record names of Text data type, the maximum length that users can enter is 32 characters. For record names of Automatically Generated Sequence data type, the sequence number is based on a display format which is up to 28 characters and has at least one number token: {0}.

    5. Select the Prevent duplicate values? check box to prevent users from entering records with duplicate names.

      1. If the Prevent duplicate values? check box is selected, then the Treat "ABC" and "Abc" as distinct values check box is enabled.

        Select this check box if you want the assessment for duplicate records to be case sensitive.

    6. Object Name

      The object name is the internal name for the object.

      Note: You can use a custom object's internal name only once across the mainline code and all existing sandboxes. If you previously used an object's internal name in a sandbox, you can reuse that same internal name, but you must first you delete all other sandboxes where the internal name was previously used. You can use a custom object's display name as many times as you want across sandboxes. The restriction applies only to the internal name.
    7. Description

  4. Click OK.

    Once your custom object is created, you must add fields and then create the UI pages where your users can create actual records. See Define Fields and Create a Set of Application Pages for Custom Objects.

Tip: To create a custom child object, click the Create Child Object button from the parent object's Object Overview page. See the next section in this topic.Once created, a child object can't be changed to a parent object. Similarly, a parent object can't be changed to a child object.Child objects are discussed below.

Delete a Custom Object

Application Composer doesn't support the deletion of either standard or custom objects. If you no longer need an object that was already published to the mainline metadata, optionally enter a note in the description that the object is no longer used.

Use the Object Overview Page

The Object Overview page provides a high-level overview of a standard or custom object. The Object Overview page displays the primary attributes for an object, plus a list of child objects and related objects, if any.

To access the Object Overview page:

  1. On the main Overview page, select the object in the object tree or select the Standard Objects or Custom Objects node in the object tree, or the icon in the local area of the main Overview page.

  2. Select the object from the resulting summary table, and click the Edit icon.

From the Object Overview page, you can:

  • Edit the object's primary attributes, described in the previous section. For example, change the Display Label or Record Name Label.

  • Change the display icon for the object.

    This process is described as follows:

  • View the parent child relationships that were created for this object.

    You can also create new child objects from this page, which implicitly creates a new parent child relationship.

  • View the non-parent child relationships that were created for this object.

Edit an Object's Attributes

After an object has been created, you can edit its attributes from its Object Overview page.

To edit an object's attributes:

  1. Access the Object Overview page for the object, as described earlier.

  2. On the Object Overview page, click Edit:

    • Change the object's primary attributes, such as display label, description, and record name, at any time.

    • You can't change the Object Name and API Name after the object has been created.

      A custom object's API name is automatically derived using the logical name followed by _c. You use the API name in Groovy expressions that you build with the expression builder, when writing business logic for the object.

Select the Display Icon for Objects

From the Object Overview page, you can select the display icon to use for the object's UI pages. You can select the display icon for custom objects (although a default icon is provided), and you can change the icon for standard objects. The icon you select determines which icon and theme display to your end users in a variety of locations, such as on the Navigator, subtabs, mobile pages, and the springboard strip on application pages.

Tip: The icon selected for standard objects is inherited across your applications. For example, if you change the display icon for the Opportunity object, then all UI pages are automatically updated to the new icon. This includes even custom subtabs that you added using Application Composer.

To select the icon:

  1. Click the object's node in the object tree to view the object's Overview page.

  2. On the Overview page, set the icon for the object in the Display Icon region.

View Child and Related Objects

The Object Overview page displays a list of child objects and related objects, if any. You can also create new child objects from this page.

  • A child object is an object with a cascade delete relationship to a parent object. This means that if you delete the parent object record, then all its child records are automatically deleted. A child object doesn't exist outside the context of the parent object, and doesn't have its own work area. You can't change a child object to a parent object after the child object has been created.

  • Related objects can exist independently of each other, even if one object is deleted. Related objects are connected in a foreign key-based relationship between two top-level objects, not as parent and child. These types of relationships include reference relationships and dynamic choice list relationships.

    Related objects can have either a one-to-many or a many-to-one relationship with the current object. Note that an object can be related to itself to model a hierarchy of the object. In this case, the object itself is displayed on its Object Overview page as a related object. For example, the Department and Sub-department objects would be displayed in this way.

    Note: You don't create these types of relationships from this page. Instead, manage relationships from the Relationships page, which you can access from Application Composer's main Overview page. Or, create a dynamic choice list relationship by creating a dynamic choice list field for an object, which derives its choice list values from another object.

To create a child object for a standard or custom object:

  1. Navigate to an object's Object Overview page.

  2. Click the Create Child Object button. Creating a child object is the same as creating a custom object, except:

    • The current object is automatically displayed as the parent object.

    • Specify the Child Collection Name field to specify the internal name for this set of child object records, which can be used later when writing Groovy scripts.