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
- Create a view model schema of the connected entity profile. To do this, follow the guide in a separate article: Client module.
-
Set up the connected entity profile in the view model schema.
- Add the ProfileSchemaMixin mixin to the mixins property.
- Add a configuration object with the settings of the connected custom profile to the diff array of modifications.
- 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.
-
Add a connected custom profile to the record page in the replacing view model schema.
- 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.
- 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.
1. Create a view model schema of the connected account profile.
- Go to the Configuration section and select a custom package to add the schema.
-
Click Add → Page view model on the section list toolbar.
-
Fill out the schema properties.
- Set Code to "UsrAccountProfileSchema."
- Set Title to "Account profile."
- Select "AccountProfileSchema" in the Parent object property.
- Add the ProfileSchemaMixin mixin as a dependency to the declaration of the view model class.
-
Set up the custom connected account profile.
- Add the ProfileSchemaMixin mixin to the mixins property.
- 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.
- Click Save on the Designer's toolbar.
2. Create a replacing view model schema of the contact page
- Go to the Configuration section and select a custom package to add the schema.
-
Click Add → Replacing view model on the section list toolbar.
-
Fill out the schema properties.
- Set Code to "ContactPageV2."
- Set Title to "Display schema - Contact card."
- Select "ContactPageV2" in the Parent object property.
- Add BaseFiltersGenerateModule, BusinessRuleModule, ContactPageV2Resources, ConfigurationConstants, ContactCareer, DuplicatesSearchUtilitiesV2, and UsrAccountProfileSchema modules to the declaration of the view model class as dependencies.
-
Add the custom connected account profile to the contact page.
- Add a module of the custom connected account profile to the modules property.
- 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.
- 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 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
The master column value.
Data about the master column.
The template of the data item marker.
Messages
Name | Mode | Direction | Description |
---|---|---|---|
Entity |
Broadcasting | Subscription | The initialization event of the main entity. |
Get |
Broadcasting | Subscription | Handles the changes to the entity column. |
Get |
Address | Publish | Returns the queried column values. |
Get |
Address | Publish | Retrieves the query filter lookup. |
Get |
Address | Publish | Retrieves the column data. |
Update |
Address | Publish | Changes the value of the model's card. |
Open |
Address | Publish | Opens the add page. |
Card |
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
Returns the mini page configuration.
{Object} options | The mini page properties. |
Returns the configuration lookup of the open lookup.
{Object} config | The configuration of the open lookup page. |
Returns the visibility tag of the BlankSlateContainer container.
Returns the visibility tag of the ProfileContentContainer container.
Returns the tooltip of the Clear button.
Retrieves the update configuration properties of the card on card save.
{Object} response | The response from the server. |
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.
Messages
Profile |
Broadcasting | Publishing | Handles the changes to the profile entity column. |
Get |
Address | Subscription | Returns the queried column values. |
Profile |
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 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
Profile |
Broadcasting | Subscription | Handles the changes to the profile entity column. |
Get |
Address | Publish | Sends the queried column values. |
Profile |
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.