Question

Passing Two Expressions as Arguments in addSchemaColumnFilterWithParameter

Hello Creatio Community,

I’m working on creating a custom complex filter logic in a User Page JS and ran into a problem.

The following code works fine:

filter.addSchemaColumnFilterWithParameter(
    sdk.ComparisonType.Equal,
    "[TableA:TableB].ColumnX.Id",
    "1048f156-620f-4e01-8796-a43ee5182dcc"
);

However, this does not work:

filter.addSchemaColumnFilterWithParameter(
    sdk.ComparisonType.Equal,
    "[TableA:TableB].ColumnX.Id",
    "[TableA:TableB].ColumnX.[TableC:TableD].ColumnY.Id"
);

It seems like addSchemaColumnFilterWithParameter does not accept two expressions as parameters (i.e., the second argument as a schema column and the third argument as another schema column instead of a value).

Is there any other function or approach that allows passing two schema column expressions to create a complex filter like this?

Like 1

Like

1 comments

Hello,

The method addSchemaColumnFilterWithParameter is designed to compare a column with a fixed value and does not support comparing two expressions directly.

Here is an article from Creatio documentation that explains the correct way to build such filters:
createFilter allows to compare one schema column to another.

Example:
var esq = Ext.create("Terrasoft.EntitySchemaQuery", { rootSchemaName: "YourObject" });
var columnCompareFilter = esq.createFilter(
   Terrasoft.ComparisonType.EQUAL,
   "[TableA:TableB].ColumnX.Id",
   "[TableA:TableB].ColumnX.[TableC:TableD].ColumnY.Id"
);
esq.filters.add("ColumnCompare", columnCompareFilter);

This will compare the values of the two schema column expressions instead of using a constant parameter.

Show all comments