Skip to main content
Version: 8.1

Add a field to a record page using a new column

Level: intermediate
Example

Add a Meeting place field to the activity page. Before you add the field, add a corresponding column to the activity object schema.

1. Create a replacing object schema

  1. Go to the Configuration section and select a custom package to add the schema.

  2. Click AddReplacing object on the section list toolbar.

  3. Fill out the schema properties.

    • Set Code to "Activity."
    • Set Title to "Activity."
    • Select "Activity" in the Parent object property.
  4. Add a column to the schema.

    1. Click add_button in the context menu of the object structure's Columns node.

    2. Click TextText (250 characters) in the drop-down menu.

    3. Fill out the properties of the added column.

      • Set Code to "UsrMeetingPlace."
      • Set Title to "Meeting place."
  5. Click Save then Publish on the Object Designer's toolbar.

2. Create a replacing view model schema of the activity page

  1. Go to the Configuration section and select a custom package to add the schema.

  2. Click AddReplacing view model on the section list toolbar.

  3. Fill out the schema properties.

    • Set Code to "ActivityPageV2."
    • Set Title to "Activity edit page."
    • Select "ActivityPageV2" in the Parent object property.
  4. Add a localizable string.

    1. Click the button in the context menu of the Localizable strings node.

    2. Fill out the localizable string properties.

      • Set Code to "MeetingPlaceCaption."
      • Set Value to "Meeting place."
    3. Click Add to add a localizable string.

  5. Set up the field layout. To do this, add a configuration object with the settings that determine the field layout to the diff array of modifications.

    View the source code of the replacing view model schema of the activity page below.

    ActivityPageV2
    define("ActivityPageV2", [], function() {
    return {
    /* The name of the record page object's schema. */
    entitySchemaName: "Activity",
    /* Display the field on the record page. */
    diff: /**SCHEMA_DIFF*/[
    /* The properties to add the custom field to the page. */
    {
    /* Add the element to the page. */
    "operation": "insert",
    /* The meta name of the parent container to add the field. */
    "parentName": "Header",
    /* Add the field to the parent element's collection of elements. */
    "propertyName": "items",
    /* The meta name of the field to add. */
    "name": "UsrMeetingPlace",
    /* The properties to pass to the element's constructor. */
    "values": {
    /* Bind the field caption to the localizable schema string. */
    "caption": {"bindTo": "Resources.Strings.MeetingPlaceCaption"},
    /* Set up the field layout. */
    "layout": {
    /* The column number. */
    "column": 0,
    /* The column span. */
    "row": 5,
    /* The column span. */
    "colSpan": 12
    }
    }
    }
    ]/**SCHEMA_DIFF*/
    };
    });
  6. Click Save on the Designer's toolbar.

Outcome of the example

To view the outcome of the example:

  1. Clear the browser cache.
  2. Refresh the Activities section page.

As a result, Creatio will add a Meeting place field to the page.


Resources

Package with example implementation