Creatio development guide
PDF
This documentation is valid for Creatio version 7.12.0. We recommend using the newest version of Creatio documentation.

Details

Glossary Item Box

Introduction

Details are used to display supplemental data for a primary section object. The section details are displayed on the section edit page tabs in the tabs area.

Depending on the method of entering and displaying data, there are following types of details.

  • Details with edit fields.
  • Details with adding page.
  • Details with editable list.
  • Details with selection from lookup.

More information about details of different types can be found in the "Details” article.

The detail creation

A custom detail must be registered so that the detail wizard could work with it. To register a detail, add a record with detail caption, detail schema identifier DetailSchemaUid (from the UId column in the SysSchema table) and detail object schema identifier EntitySchemaUId (from the UId column in the SysSchema table) to the SysDetail table.

More information about creating details of different types can be found in the "Adding details” article.

The base schema of the BaseDetailV2 detail

All detail schemas must be inherited from the BaseDetailV2 base schema. The base logic of data initialization and communication with the edit page are implemented in the schema.

The base schema class has the following properties:

BaseDetailV2 messages

The massages are used for communication between the detail and the edit page. A full list of messages, their broadcast mode and direction are given in the table 1.

Table 1. The messages of the base detail

Name Mode Direction Description
GetCardState Address Publication Returns a state of the edit page.
SaveRecord Address Publication Tells the edit page to save the data.
DetailChanged Address Publication Tells the edit page about the changes of the detail data.
UpdateDetail Address Subscription A subscription to the edit page update.
OpenCard Address Publication Opens edit page.

The message modes are defined in the Terrasoft.core.enums.MessageMode enumeration and message direction is defined in the Terrasoft.core.enums.MessageDirectionType. More information about them can be found in the “JavaScript API for platform core” article.

BaseDetailV2 attributes

The attributes property contains the attributes of detail view model. The attributes that are defined in base detail class are given in the table 2.

Table 2. The attributes of the base detail

Name Type Description
CanAdd BOOLEAN Indicates the possibility to add data.
CanEdit BOOLEAN Indicates the possibility to edit data.
CanDelete BOOLEAN Indicates the possibility to delete data.
Collection COLLECTION Detail data collection.
Filter CUSTOM_OBJECT Detail filter. Used for filtering detail data.
DetailColumnName STRING The column name where the filtering is performed.
MasterRecordId GUID The key value of the parent record.
IsDetailCollapsed BOOLEAN Indicates if the detail is collapsed.
DefaultValues CUSTOM_OBJECT The default value of the model columns.
Caption STRING The detail caption.

The available attribute data types are represented by the Terrasoft.DataValueType enumeration. More information about them can be found in the “JavaScript API for platform core” article.

BaseDetailV2 methods

The methods defined in base detail class are given in the table 3.

Table 3. The methods of the base detail

Name Parameters Description
init

{Function} callback – callback function.

{Object} scope – the context of the method execution.

Initializes the detail page.
initProfile No Initializes the schema profile. Default value is Terrasoft.emptyFn
initDefaultCaption No Sets the default caption of the detail.
initDetailOptions No Initializes the list view data collection.
subscribeSandboxEvents No It is subscribed to the messages necessary for the work of the detail.
getUpdateDetailSandboxTags No Generates the array of tags for the UpdateDetail message.
UpdateDetail {Object} config – configuration object that contains the properties of the detail. Updates the detail according to the parameters passed. Default value is Terrasoft.emptyFn
initData

{Function} callback – callback function.

{Object} scope – the context of the method execution.

Initializes the list view data collection.
getEditPageName No Returns the name of the edit page depending on the record type at editing or on selected record type for adding.
onDetailCollapsedChanged {Boolean} isCollapsed – the attribute of the collapsed/expanded detail. The handler of collapsing or expanding of the detail.
getToolsVisible No Returns the collapse value of the detail.
getDetailInfo No Publishes a message to get information about the detail.

BaseDetailV2 array of modifications

In the diff modifications array of the base detail, only a base container for detail view is defined:

diff: /**SCHEMA_DIFF*/[
  // Base container for detail view.
  {
     "operation": "insert",
     "name": "Detail",
     "values": {...}
  }
]/**SCHEMA_DIFF*/

The “BaseGridDetailV2” base “detail with list” class

The class is a BaseDetailV2 inheritor. All details with lists must be the BaseGridDetailV2 inheritors. The list base logic (import, filtering, adding, deleting and editing the detail records) is implemented in the BaseGridDetailV2 schema.

More information about creating custom details can be found in the" Adding a detail with an editable list” article.

BaseGridDetailV2 messages

Main BaseGridDetailV2 messages are given in table 4.

Table 4. The messages of the detail with a list

Name Mode Direction Description
getCardInfo Address Subscription Returns information about the edit page: its default values, type column name and type column value.
CardSaved Broadcasting Subscription Handles a message of saving the edit page.
UpdateFilter Broadcasting Subscription Refreshes filters in the detail.
GetColumnsValues Address Publication

Receives the column values of the edit page model.

The message modes are defined in the “Terrasoft.core.enums.MessageMode” enumeration and message direction in the “Terrasoft.core.enums.MessageDirectionType” enumeration. More information about them can be found in the “JavaScript API for platform core” article.

BaseGridDetailV2 attributes

Main BaseGridDetailV2 attributes are given in table 5.

Table 5. The attributes of the detail with a list

Name Type Description
ActiveRow GUID The value of the primary column of the active record in the list.
IsGridEmpty BOOLEAN Indicates that the list is empty.
MultiSelect BOOLEAN Indicates if multiple selection is permitted.
SelectedRows COLLECTION An array of selected values.
RowCount INTEGER Number of rows in the list.
IsPageable BOOLEAN Indicates if the page-by-page loading is enabled.
SortColumnIndex INTEGER Index of the sorting column.
CardState TEXT Opening mode for the record edit page.
EditPageUId GUID A unique identifier of the edit page.
ToolsButtonMenu COLLECTION The collection of the functional button’s drop-down list.
DetailFilters COLLECTION Collection of the detail filters.
IsDetailWizardAvailable BOOLEAN Indicates if the detail wizard is available.

The available attribute data types are represented by the Terrasoft.DataValueType enumeration. More information about them can be found in the “JavaScript API for platform core” article.

BaseGridDetailV2 mixins

Main BaseGridDetailV2 mixins are given in the table 6.

Table 6. The attributes of the detail with a list

Name Class Description
GridUtilities Terrasoft.GridUtilities Mixin for the list.
WizardUtilities Terrasoft.WizardUtilities Mixin for the detail wizard.

More information about the GridUtilities mixin is given below.

BaseGridDetailV2 methods

Main BaseGridDetailV2 methods are given in table 7.

Table 7. The methods of the base detail with a list

Name Parameters Description
init

{Function} callback – callback function.

{Object} scope – the context of the method execution.

Overrides the BaseDetailV2 method. Calls the parent’s init method logic, registers the messages, initializes the filters.
initData

{Function} callback – callback function.

{Object} scope – the context of the method execution.

The override of the BaseDetailV2 method. Calls the parent’s initData method logic, initializes the data collection of the list view.
loadGridData No Executes the load of the list data.
initGridData No Executes the initialization of the default values for working with the list.
getGridData No Returns list collection.
getFilters No Returns the detail filter collection.
getActiveRow No Returns the identifier of the selected record in the list.
addRecord {String} editPageUId – identifier of typed edit page. Adds the new record to the list. Saves the edit page, if needed.
copyRecord {String} editPageUId – identifier of typed edit page. Copies the record and opens the edit page.
editRecord {Object} record – record model for editing. Opens edit page of the selected record.
subscribeSandboxEvents No It is subscribed to the messages necessary for the detail operation.
UpdateDetail {Object} config – configuration object that contains the properties of the detail. The override of the BaseDetailV2 method. Calls the parent’s updateDetail method logic, updates the detail.
OpenCard

{String} operation – operation type (creating/modifying)

{String} typeColumnValue – the value of record typing column.

{String} recordId – record identifier.

Opens edit page.
onCardSaved No Handles the save event of the edit page where the detail is located.
addToolsButtonMenuItems {Terrasoft.BaseViewModelCollection} toolsButtonMenu – The collection of the functional button drop-down list. Adds elements to the collection of the functional button drop-down list.
initDetailFilterCollection No Initializes the detail filter.
setFilter

{String} key – filter type.

{Object} value – filter value.

Sets the detail filter value.
loadQuickFilter {Object} config – parameters of the filters module load. Loads the quick filter.
destroy No Clears the data, exports the detail.

BaseGridDetailV2 array of modifications

In the diff modifications array of the base detail, only a base container for detail view is defined:

diff: /**SCHEMA_DIFF*/ [
  {
    // Element for displaying the list.
    "operation": "insert",
    "name": "DataGrid",
    "parentName": "Detail",
    "propertyName": "items",
    "values": {
      "itemType": Terrasoft.ViewItemType.GRID,
      …
    }
  },
  {
    // List reloading button.
    "operation": "insert",
    "parentName": "Detail",
    "propertyName": "items",
    "name": "loadMore",
    "values": {
      "itemType": Terrasoft.ViewItemType.BUTTON,
      …
    }
  },
  {
    // Record adding button.
    "operation": "insert",
    "name": "AddRecordButton",
    "parentName": "Detail",
    "propertyName": "tools",
    "values": {
      "itemType": Terrasoft.ViewItemType.BUTTON,
      …
    }
  },
  {
    // Typed record adding button.
    "operation": "insert",
    "name": "AddTypedRecordButton",
    "parentName": "Detail",
    "propertyName": "tools",
    "values": {
      "itemType": Terrasoft.ViewItemType.BUTTON,
      …
    }
  },
  {
    // Detail menu.
    "operation": "insert",
    "name": "ToolsButton",
    "parentName": "Detail",
    "propertyName": "tools",
    "values": {
      "itemType": Terrasoft.ViewItemType.BUTTON,
      …
    }
  }
] /**SCHEMA_DIFF*/

The GridUtilitiesV2 mixin

GridUtilitiesV2 is a mixin that implements the logic of the “list” control. Features that are implemented in the Terrasoft.configuration.mixins.GridUtilities class:

  1. Message subscription
  2. Data load.
  3. Working with the list:
    • selection of the records (the search of the active records)
    • adding, deleting and modifying the records
    • setting up the filters
    • sorting
    • exporting to the file
    • checking the access permissions to the list records

GridUtilitiesV2 methods

Main GridUtilitiesV2 methods are given in table 8.

Table 8. The methods of the base detail with a list

Name Parameters Description
init

No

Subscribes to the events.
destroy No Deletes event subscriptions.
loadGridData No Executes the load of the list data.
beforeLoadGridData No Prepares the view model to the data load.
afterLoadGridData No Prepares the view model after the data load.
onGridDataLoaded {Object} response – the result of fetching the data from the database. A handler of the data load event. Executes when the server returns the data.
addItemsToGridData

{Object} dataCollection – collection of new elements.

{Object} options – adding parameters.

Adds a collection of new elements to the list collection.
reloadGridData No Reloads the list.
initQueryOptions {Terrasoft.EntitySchemaQuery} esq – in this query the necessary settings will be initialized. Initializes the settings of the query instance, such as pagination and hierarchy.
initQuerySorting {Terrasoft.EntitySchemaQuery} esq – in this query the necessary settings will be initialized. Initializes the sorting column.
prepareResponseCollection {Object} collection – list elements collection. Modifies the data collection before loading it to the list.
getFilters No Returns filters that are applied to current schema. It is overridden in the inheritors.
exportToFile No Exports the contents of the list into a file.
sortGrid {String} tag – a key that shows how to sort the list. Performs list sorting.
deleteRecords No Initiates the deletion of the selected records.
checkCanDelete

{Array} items – the identifiers of the selected records.

{Function} callback – callback function.

{Object} scope – the context of the method execution.

Checks the ability to delete a record.
onDeleteAccept No Performs the deletion after the confirmation of the user.
getSelectedItems No Returns the selected records in the list.
removeGridRecords {Array} records – deleted records. Removes the deleted records from the list.

A detail with editable list

A detail with editable list enables editing records directly in the list without going to the record editing page. To make a detail list editable, you need to modify its schema the following way:

  1. Add the dependencies from the ConfigurationGrid, ConfigurationGridGenerator and ConfigurationGridUtilities modules.
  2. Connect the ConfigurationGridUtilites and OrderUtilities mixins.
  3. Set the IsEditable attribute to “true”.
  4. Add a configuration object in the modification array where the properties will be set and the methods that handle the detail list events will be bound.

The development case of creating a detail with an editable list can be found in the "Adding a detail with an editable list” article.

The “ConfigurationGrid” module

The ConfigurationGrid module contains the implementation of the “Configuration Grid” control. The Terrasoft.ConfigurationGrid class is the inheritor of the Terrasoft.Grid class. Main Terrasoft.ConfigurationGrid methods are given in table 9.

Table 9. Configuration grid methods

Name Parameters Description
init

No

Initializes a component. Subscribes to the events.
activateRow {String|Number} id – the identifier of the list string. Selects the string and adds edit elements.
deactivateRow {String|Number} id – the identifier of the list string. Removes selection of a string and removes edit elements.
formatCellContent

{Object} cell – the cell.

{Object} data – the data.

{Object} column – the cell configuration.

Formats the data of a string cell.
onUpdateItem {Terrasoft.BaseViewModel} item – collection element. The handler of the record update event.
onDestroy No Destroys the list and its components.

ConfigurationGridGenerator module

The Terrasoft.ConfigurationGridGenerator generates list configuration and is an inheritor of the Terrasoft.ViewGenerator class. The methods that are implemented in the Terrasoft.ConfigurationGridGenerator class are given in table 10.

Table 10. The methods of the configuration grid generator

Name Parameters Description
addLinks No Overridden method of the Terrasoft.ViewGenerator class. No links will be added to the editable list.
generateGridCellValue

{Object} config – column configuration.

Overridden method of the Terrasoft.ViewGenerator class. Generates a value configuration in the cell.

The ConfigurationGridUtilities module

The Terrasoft.ConfigurationGridUtilities class contains methods that initialize a view model of the list string, process the active record actions and handle “hotkeys”.

The main properties of the Terrasoft.ConfigurationGridUtilities class are given in table 11 and its methods are provided in table 12.

Table 11. The Terrasoft.ConfigurationGridUtilities class properties

Name Type Description
currentActiveColumnName String The name of the currently selected column.
columnsConfig Object Column configuration.
systemColumns Array Collection of the system column names.

Table 12. The Terrasoft.ConfigurationGridUtilities class methods

Name Parameters Description
onActiveRowAction

{String} buttonTag – a tag of the selected action.

{String} primaryColumnValue – active record identifier.

Handles clicking an action of the active record.
saveRowChanges

{Object} row – list string.

{Function} callback – callback function.

{Object} scope – the callback function context.

Saves the record.
activeRowSaved

{Object} row – list string.

{Function} callback – callback function.

{Object} scope – the callback function context.

Handles the result of saving the record.
initActiveRowKeyMap {Array} keyMap – events description. Initializes the subscription to the button events in the active string.
getCellControlsConfig {Terrasoft.EntitySchemaColumn} entitySchemaColumn – the column of the list cell. Returns the configuration of the list cell edit items.
copyRow {String} recordId – the identifier of a copying record Copies and adds a record to the list.
initEditableGridRowViewModel

{Function} callback – callback function.

{Object} scope – the callback function context.

Initializes the classes of the collection elements of the edited list.

© bpm'online 2002-2019.

Did you find this information useful?

How can we improve it?