Connected entity profile

Advanced

Connected entity profile is a control that is an info block by default. Creatio populates the block with data of the connected entity on page load. Creatio uses the element as a connected record profile on the section record page. For example, when you open a contact page, Creatio displays the contact profile and data of the connected account in the container of the left record page area (LeftModulesContainer). The account is connected to the contact by the Account column of the Contact object. Learn more about the record profile and connected record profile in user documentation: Work with record pages.

The following components implement the functionality of the connected entity profile:

  • Profile class.
  • BaseProfileSchema. Base schema to create a connected entity profile. Lets you display any set of fields of a connected entity, as well as any number of modules. Parent class of the Profile class. Inherit the schemas of connected entity profiles from BaseProfileSchema.
  • BaseMultipleProfileSchema. Base schema to create a connected entity profile that includes several profiles and switches between them freely using the lookup value selection mechanism. The main difference from the base profile is the ability to embed other profiles in the current profile. The embedded profiles can communicate with each other via messages. Inherit the BaseMultipleProfileSchema profiles from the BaseRelatedProfileSchema base schema that implements dependent profiles or profiles embedded in other profiles.

Add a connected entity profile 

  1. Create a view model schema of the connected entity profile. To do this, follow the guide in a separate article: Client module.
  2. Set up the connected entity profile in the view model schema.

    1. Add the ProfileSchemaMixin mixin to the mixins property.
    2. Add a configuration object with the settings of the connected custom profile to the diff array of modifications.
  3. Create a replacing view model schema of the record page that contains the field. To do this, follow the guide in a separate article: Client module.
  4. Add a connected custom profile to the record page in the replacing view model schema.

    1. Add a module of the connected custom account profile to the modules property. Add the name of the column that connects the connected profile to the main record page schema to the masterColumnName property of the viewModelConfig property. The Profile class fetches data based on this column value.
    2. Add a configuration object with the settings that determine the layout of the connected custom account profile to the diff array of modifications.

The Profile class fetches data based on the value of the column specified in the masterColumnName property. The Profile class executes the following actions at the stage of profile object implementation:

  • send the GetColumnInfo message to retrieve additional data about the connecting column (filters, title, etc.)
  • request the name of the connecting column

    • If the connected profile is not empty (i. e., the connection field has a record selected), initialize data based on the record.
    • If the connected profile is empty (i. e., the connection field does not have a record selected), display the following instead of the connected account profile:

      • The name of the field that connects the record. For example, the contact page displays the connected account profile connected to the contact by the Account field.
      • New account: create a new record in the connection field lookup.
      • Search: select an existing entity from the index.

View a contact profile that contains a connected account profile in the figure below.

View a contact profile that does not contain a connected account profile in the figure below.

When you clear the field or change the value in the profile object, Creatio re-initializes the data. When you select an existing connected entity, Creatio applies the business logic (defined on the record page and connected to the referring entity attribute) to the lookup. I. e., filtering, query column settings, etc. are preserved. If you delete the attribute from the record page schema, Creatio also deletes the business logic.

Add a custom connected entity profile to a record page
Advanced

Example. Add a custom connected account profile to the contact page.

1. Create a view model schema of the connected account profile. 

  1. Go to the Configuration section and select a custom package to add the schema.
  2. Click AddPage view model on the section list toolbar.

  3. Fill out the schema properties.

    • Set Code to "UsrAccountProfileSchema."
    • Set Title to "Account profile."
    • Select "AccountProfileSchema" in the Parent object property.
  4. Add the ProfileSchemaMixin mixin as a dependency to the declaration of the view model class.
  5. Set up the custom connected account profile.

    1. Add the ProfileSchemaMixin mixin to the mixins property.
    2. Add a configuration object with the settings of the custom connected account profile to the diff array of modifications.

    View the source code of the view model schema of the connected account profile below.

    UsrAccountProfileSchema
    /* Specify the ProfileSchemaMixin mixin as a dependency. */
    define("UsrAccountProfileSchema", ["ProfileSchemaMixin"], function () {
        return {
            /* The name of the object schema. */
            entitySchemaName: "Account",
            /* Mixins. */
            mixins: {
                /* The mixin with functions that retrieve profile icons and images. */
                ProfileSchemaMixin: "Terrasoft.ProfileSchemaMixin"
            },
            /* The diff array of modifications. */
            diff: /**SCHEMA_DIFF*/[
                {
                    /* The insert operation. */
                    "operation": "insert",
                    /* The entity name. */
                    "name": "Contact",
                    /* The name of the parent element to insert the element. */
                    "parentName": "ProfileContentContainer",
                    /* The parent element property on which to operate. */
                    "propertyName": "items",
                    /* The element value. */
                    "values": {
                        /* Bind the Contact object to the value of the Account property. */
                        "bindTo": "Account",
                        /* The layout configuration. Element position. */
                        "layout": {
                            "column": 3,
                            "row": 10,
                            "colSpan": 19
                        }
                    }
                }
                /* Other configuration objects of the array of modifications. */
            ]/**SCHEMA_DIFF*/
        };
    });
    
  6. Click Save on the Designer's toolbar.

2. Create a replacing view model schema of the contact 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 "ContactPageV2."
    • Set Title to "Display schema - Contact card."
    • Select "ContactPageV2" in the Parent object property.
  4. Add BaseFiltersGenerateModule, BusinessRuleModule, ContactPageV2Resources, ConfigurationConstants, ContactCareer, DuplicatesSearchUtilitiesV2, and UsrAccountProfileSchema modules to the declaration of the view model class as dependencies.
  5. Add the custom connected account profile to the contact page.

    1. Add a module of the custom connected account profile to the modules property.
    2. Add a configuration object with the settings that determine the layout of the custom connected account profile to the diff array of modifications.

    View the source code of the replacement view model of the contact page below.

    ContactPageV2
    /* Define the record page schema and its dependencies. */
    define("ContactPageV2", ["BaseFiltersGenerateModule", "BusinessRuleModule", "ContactPageV2Resources", "ConfigurationConstants", "ContactCareer", "DuplicatesSearchUtilitiesV2", "UsrAccountProfileSchema"], function (BaseFiltersGenerateModule, BusinessRuleModule, resources, ConfigurationConstants, ContactCareer) {
        return {
            entitySchemaName: "Contact",
            /* The modules. */
            modules: /**SCHEMA_MODULES*/{
                /* The account profile module. */
                "AccountProfile1": {
                    /* The profile configuration. */
                    "config": {
                        /* The schema name. */
                        "schemaName": "UsrAccountProfileSchema",
                        /* The flag that communicates the initialization of the schema configuration. */
                        "isSchemaConfigInitialized": true,
                        /* The flag that specifies that HistoryState is not used. */
                        "useHistoryState": false,
                        /* The profile parameters. */
                        "parameters": {
                                /* The view model configuration. */
                            "viewModelConfig": {
                                /* The name of the connected entity column. */
                                masterColumnName: "Account"
                            }
                        }
                    }
                }
            }/**SCHEMA_MODULES*/,
            /* The array of modifications. */
            diff: /**SCHEMA_DIFF*/[
                {
                    /* The insert operation. */
                    "operation": "insert",
                    /* The name of the parent element to insert the element. */
                    "parentName": "LeftModulesContainer",
                    /* The name of the parent element property on which to operate. */
                    "propertyName": "items",
                    /* The entity name. */
                    "name": "AccountProfile1",
                    /* The value of the element to add. */
                    "values": {
                        /* Set the element type to module. */ 
                        "itemType": Terrasoft.ViewItemType.MODULE
                    }
                }
            ]/**SCHEMA_DIFF*/
        };
    });
    
  6. Click Save on the Designer's toolbar.

Outcome of the example 

To view the outcome of the example, refresh the Contacts section page.

As a result, Creatio will add the custom connected account profile to the contact page.

BaseProfileSchema schema
Medium

BaseProfileSchema is a base schema to create a connected entity profile. Lets you display any set of fields of a connected entity, as well as any number of modules. Implemented in the NUI package. This is a view model schema. Learn more about the schema properties in a separate article: Client schema. Inherit the schemas of connected entity profiles from BaseProfileSchema.

Attributes 

MasterColumnValue GUID

The master column value.

MasterColumnInfo CUSTOM_OBJECT

Data about the master column.

DataItemMarkerTpl TEXT

The template of the data item marker.

Messages 

Messages of the base schema
Name Mode Direction Description
EntityInitialized Broadcasting Subscription The initialization event of the main entity.
GetEntityColumnChanges Broadcasting Subscription Handles the changes to the entity column.
GetColumnsValues Address Publish Returns the queried column values.
GetLookupQueryFilters Address Publish Retrieves the query filter lookup.
GetColumnInfo Address Publish Retrieves the column data.
UpdateCardProperty Address Publish Changes the value of the model's card.
OpenCard Address Publish Opens the add page.
CardModuleResponse Address Subscription The response of the module card.

The Terrasoft.core.enums.MessageMode enumeration represents the message modes, and the Terrasoft.core.enums.MessageDirectionType enumeration represents the message directions. Learn more about the MessageMode enumeration in the JS class library. Learn more about the MessageDirectionType enumeration in the JS class library.

Methods 

getMiniPageConfig(options)

Returns the mini page configuration.

Parameters
{Object} options The mini page properties.
getLookupConfig(config)

Returns the configuration lookup of the open lookup.

Parameters
{Object} config The configuration of the open lookup page.
getVisibleBlankSlate()

Returns the visibility tag of the BlankSlateContainer container.

getVisibleContent()

Returns the visibility tag of the ProfileContentContainer container.

getClearButtonHint()

Returns the tooltip of the Clear button.

getUpdateCardPropertyConfig(response)

Retrieves the update configuration properties of the card on card save.

Parameters
{Object} response The response from the server.
BaseMultipleProfileSchema schema
Medium

BaseMultipleProfileSchema is a base schema to create a connected entity profile that includes several profiles and switches between them freely using the lookup value selection mechanism. Implemented in the NUI package. This is a view model schema. Learn more about the schema properties in a separate article: Client schema. Inherit the BaseMultipleProfileSchema profiles from the BaseRelatedProfileSchema base schema that implements dependent profiles or profiles embedded in other profiles.

Attributes 

EditColumnName STRING

The name of the card property column.

MasterColumnNames CUSTOM_OBJECT

The array of names of master module columns.

Messages 

Messages of the base schema
Name
Mode
Direction
Description
ProfileEntityColumnChanges Broadcasting Publishing Handles the changes to the profile entity column.
GetProfileEntityColumnChanges Address Subscription Returns the queried column values.
ProfileOpenCard Address Subscription Sends the query of the open configuration card.

The Terrasoft.core.enums.MessageMode enumeration represents the message modes, and the Terrasoft.core.enums.MessageDirectionType enumeration represents the message directions. Learn more about the MessageMode enumeration in the JS class library. Learn more about the MessageDirectionType enumeration in the JS class library.

BaseRelatedProfileSchema schema
Medium

BaseRelatedProfileSchema is a base schema that implements dependent profiles or profiles embedded in other profiles. Implemented in the NUI package. This is a view model schema. Learn more about the schema properties in a separate article: Client schema. A parent schema of the BaseMultipleProfileSchema to create a connected entity profile that includes several profiles and switches between them freely using the lookup value selection mechanism.

Messages 

Messages of the base schema
Name
Mode
Direction
Description
ProfileEntityColumnChanges Broadcasting Subscription Handles the changes to the profile entity column.
GetProfileEntityColumnChanges Address Publish Sends the queried column values.
ProfileOpenCard Address Publish Sends the query of the open configuration card.

The Terrasoft.core.enums.MessageMode enumeration represents the message modes, and the Terrasoft.core.enums.MessageDirectionType enumeration represents the message directions. Learn more about the MessageMode enumeration in the JS class library. Learn more about the MessageDirectionType enumeration in the JS class library.