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

Record deactivation

Glossary Item Box

Introduction

In the bpm'online version 7.11.3 you can deactivate records of the system objects to exclude them from the business logic. It can be used if the data is outdated and will never be used. Enable this function with the [Allow record deactivation] property in the object designer (Fig. 1) and it will be enabled after object publication.

ATTENTION

In 7.11.3, these functions are disabled by default. To enable them, set the "UseRecordDeactivation" setting in the  ..\Terrasoft.WebApp\Web.config file to "true".

Fig. 1. [Allow record deactivation] property

ATTENTION

Deactivation of the records is available for all objects but automatic filtering of all records works only in drop-down lists, on the lookup selection page and in quick filters. The automatic filter is not applied on pages with lookup contents, in the advanced filters and sections.

Use case in program code

The UseRecordDeactivation parameter that defines enabling and disabling filtering by inactive records appeared in the EntitySchemaQuery. By default the parameter value is false. If you change the value to true, inactive records will be filtered from the request to select data from the object with enabled record deactivation.

Use case in client code:

var esq = Ext.create("Terrasoft.EntitySchemaQuery", {
   rootSchemaName: "MyCustomLookup",
   useRecordDeactivation: true
});

Use case in server code:

var esq = new EntitySchemaQuery(userConnection.EntitySchemaManager, "ContactType") {
    UseRecordDeactivation = true
};
esq.PrimaryQueryColumn.IsAlwaysSelect = true;
var sqlQuery = esq.GetSelectQuery(userConnection).GetSqlText();
Console.WriteLine(sqlQuery);

The text of resulting SQL query is assigned to the sqlQuery variable. After the initialization of the EntitySchemaQuery instance the query will look like following:

SELECT
  [ContactType].[Id] [Id]
FROM [dbo].[ContactType] [ContactType] WITH(NOLOCK)
WHERE
  [ContactType].[RecordInactive] = 0

© bpm'online 2002-2019.

Did you find this information useful?

How can we improve it?