Filters
today
now
current
date

How does one set a quick or advanced filter criterion to the current date or the current time?

Like 0

Like

1 comments
Best reply

Hello John,

 

If you mean adding a quick built-in filter as the one for date you can see in Activies section, unfortunately these are only available for specific sections and it is possible to customize such filters only with means of development.

Instead, you can use standard filter. If for example, you need to filter records by column "created on", click on the small calendar icon and there will be a field that will automatically set the filter for current date.

If you need to set it for current time, you need to switch to advanced mode and specify it for current hour, for example, as shown below.

Depending on what filter exactly you require you can simply modify it all to your needs. As an option, you can also save the advanced filter as afolder and mark it as favorite, so it will appear in te list as on the first screen above (favorite folder there - "Test").

Also, please feel free to check this article to understand better how filters work.

 

Kind regards,

Mira

Hello John,

 

If you mean adding a quick built-in filter as the one for date you can see in Activies section, unfortunately these are only available for specific sections and it is possible to customize such filters only with means of development.

Instead, you can use standard filter. If for example, you need to filter records by column "created on", click on the small calendar icon and there will be a field that will automatically set the filter for current date.

If you need to set it for current time, you need to switch to advanced mode and specify it for current hour, for example, as shown below.

Depending on what filter exactly you require you can simply modify it all to your needs. As an option, you can also save the advanced filter as afolder and mark it as favorite, so it will appear in te list as on the first screen above (favorite folder there - "Test").

Also, please feel free to check this article to understand better how filters work.

 

Kind regards,

Mira

Show all comments
Filters
Terrasoft.ComparisonType.EXISTS
ESQ
Service_Creatio_customer_center_edition

I'm optimising a query attempting to use a filter with 'Terrasoft.ComparisonType.EXISTS', I'm guessing at the syntax and it isn't working.  If anyone could point out where I'm going wrong here:

...
const subFilter = Terrasoft.createFilterGroup();
subFilter.addItem(Terrasoft.createColumnFilterWithParameter(Terrasoft.ComparisonType.EQUAL, "UsrRefundItem", true));
const esqSecondFilter = Terrasoft.createColumnFilterWithParameter(Terrasoft.ComparisonType.EXISTS, subFilter);
esq.filters.add("esqSecondFilter", esqSecondFilter);
...

Thanks,

 

Like 0

Like

8 comments

Hello Gareth,

 

Terrasoft.ComparisonType.EXISTS is not used in the client-side system logic anymore since it was replaced with the createExistsFilter function. So you need to use it instead of EXISTS comparison type.

 

Best regards,

Oscar

Oscar Dylan,

I have tried the following but it is returning more than one record:

const caseId = this.get("MasterRecordId");
const esq = this.Ext.create(Terrasoft.EntitySchemaQuery, {
	rootSchemaName: "UsrItemInOrder"
});
esq.addAggregationSchemaColumn("Id", Terrasoft.AggregationType.COUNT, "RefundCount", Terrasoft.AggregationEvalType.ALL);
const esqFirstFilter = esq.createColumnFilterWithParameter(Terrasoft.ComparisonType.EQUAL, "UsrCase", caseId);
esq.filters.addItem(esqFirstFilter);
var subFilter = Terrasoft.createFilterGroup();
subFilter.addItem(Terrasoft.createColumnFilterWithParameter(Terrasoft.ComparisonType.EQUAL, "UsrRefundItem", true));
const esqSecondFilter = Terrasoft.createExistsFilter("Id", subFilter);
...

I am not filtering with a subquery here, just on the one table.

Gareth Osler,

Hi Gareth. Here is a sample of how to get a count (this gets a count of all accounts with a type of "Customer", however, to just get a count of the entire table you'd just omit the filter):

var esq = this.Ext.create("Terrasoft.EntitySchemaQuery", {
    rootSchemaName: "Account"
});
esq.addAggregationSchemaColumn("Id", Terrasoft.AggregationType.COUNT, "AccountCount");
esq.filters.add(Terrasoft.createColumnFilterWithParameter(Terrasoft.ComparisonType.EQUAL, "Type.Name", "Customer"));
esq.getEntityCollection(function(result) {
    console.log("Total customers", result.collection.first().get("AccountCount"));
});

With an exists sub-filter like in your code, it would look like this:

// get a count of all accounts with a "UsrClientSystem" record that has a system type of "Creatio"
var esq = this.Ext.create("Terrasoft.EntitySchemaQuery", {
    rootSchemaName: "Account"
});
esq.addAggregationSchemaColumn("Id", Terrasoft.AggregationType.COUNT, "AccountCount");
 
var subFilter = Terrasoft.createFilterGroup();
subFilter.addItem(Terrasoft.createColumnFilterWithParameter(Terrasoft.ComparisonType.EQUAL, "UsrSystemType.Name", "Creatio"));
esq.filters.addItem(Terrasoft.createExistsFilter("[UsrClientSystem:UsrAccount].Id", subFilter));
 
esq.getEntityCollection(function(result) {
    console.log("Total accounts with Creatio system", result.collection.first().get("AccountCount"));
}, this);

Ryan

Ryan Farley, Thank you for the reply.  I am querying with an exists filter on the same table as the esq query, the esq query is on table UsrItemInOerder, for an exist filter of there exists a record with a UsrRefundItem column value of true.  What would the column path be for a createExistsFilter() call in that situation?

Gareth Osler,

I'm not 100% sure I follow. So you want to know if there's a UsrItemInOrder record for the parent Order that has a value of true for the UsrRefundItem column? If that's the case, you can just simplify the query (no need for the exists sub filter):

var esq = this.Ext.create("Terrasoft.EntitySchemaQuery", {
    rootSchemaName: "UsrItemInOrder"
});
// get a count of items with a refund
esq.addAggregationSchemaColumn("Id", Terrasoft.AggregationType.COUNT, "RefundCount");
// for all UsrItemInOrder rows for the parent Order
esq.filters.add(Terrasoft.createColumnFilterWithParameter(Terrasoft.ComparisonType.EQUAL, "Order", this.get("MasterRecordId"));
// add filter for refund items only
esq.filters.add(Terrasoft.createColumnFilterWithParameter(Terrasoft.ComparisonType.EQUAL, "UsrRefundItem", true);
// get result, this will return 1 row with a count of refund items in RefundCount column
esq.getEntityCollection(function(result) {
    var hasRefunds = (result.collection.first().get("RefundCount") > 0);
});

Ryan

Ryan Farley,

That is essentially what I have done.  But could that query be optimized with an exists query, it is being run on a database with circa 1.5 million records.

 

Gareth Osler,

What I was trying to do is illustrated in SQL terms in this stackexchange question,

SELECT TOP (1) id 
  FROM dbo.table
  WHERE price IS NULL
    AND category = 'hardware';

which I am arriving at the conclusion is not possible with a Creatio ESQ query.  The solution counting the records matching the case Id and 'UsrRefundItem'

flag true conditions is probably the fastest otherwise.

Gareth Osler,

The only way to do a "top" or "limit" that I know of via ESQ is like this:

var esq = Ext.create("Terrasoft.EntitySchemaQuery", {
	rootSchemaName: "UsrEntity"
});
// get only first row in results
esq.rowCount = 1;
esq.addColumn("Id");
// add any filters
esq.getEntityCollection(function(response) {
	// only one row returned
}, this);

To be honest, I've never ran profiler to see if rowCount=X actually does translate to TOP X or LIMIT X, but I assume it does. However, I think the previous method of getting the count would be a more efficient way. The ESQ I posted earlier is the equivalent of:

select count(Id) as RefundCount from UsrItemInOrder where OrderId = 'SOMEID' and UsrRefundItem = 1

Ryan

Show all comments

Could I ask for an example of the 'createExistsFilter(columnPath)' ESQ filter in use.  I'm not sure what 'columnPath' is.

 

Thanks,

Like 0

Like

5 comments

Hello,

 

The examples can be found here and you can also create an advanced filter in some section and review its body. For example here is the filter to list all accounts that have any activity connected to an account:

If we take a look at the network tab of the console to get the SelectQuery (to identify the needed query you can clear the network tab and then hit the "Accounts" section header in the top left corner or click the "Apply" button in the filter and as a result the query will be sent) that went to the database to retrieve data we can see the path to the column in the filters object:

comparisonType and filterType are standing for the "exists" function (can be seen in the Terrasoft.ComparisonType and Terrasoft.FilterType objects).

 

So if you need to retrieve a correct path to some column you can use this approach to find the correct path.

 

Best regards,

Oscar

Oscar Dylan,

Thanks for the reply, and the 'columnPath' tips.

 

It's actually how the  'createExistsFilter(columnPath)' ESQ filter is used that I'm not sure of.  If you could give me an example of this function being used that would be great.

Gareth Osler,

 

It's not widespread in the system, but there was one use case when it was needed and it's described in this community thread. One of the examples in the system: please see the historyMessageEsqApply method from the PortalMessageHistoryItemPage module:

filterInnerGroup.add("PortalMessageExists",
							esq.createExistsFilter("[PortalMessage:Id:RecordId].Id"))

Best regards,

Oscar

Gareth Osler,

Hi Gareth, the usage of it is just like any ESQ, it returns the list of records that match the condition(s). For the example Oscar provided, to expand on that further, lets say you want a list of all accounts where an activity exists (and then to go further) where the activity has a certain owner. In this case we create an exists filter (for accounts where activities exist) that has a sub-filter (for activities with a certain owner).

That code would look like this:

var esq = Ext.create("Terrasoft.EntitySchemaQuery", { 
	rootSchemaName: "Account" 
});
 
esq.addColumn("Id");
esq.addColumn("Name");
 
// create the sub filter for the condition inside the exists
var subFilters = Terrasoft.createFilterGroup();
subFilters.addItem(Terrasoft.createColumnFilterWithParameter(Terrasoft.ComparisonType.EQUAL, "Owner", "a6b4ea0c-420c-45ab-81e7-6e76c8cc15f7"));
 
// now create the exists filter and pass the sub filter conditions to it
// note, this second param of subFilters is optional if all you want is the exists condition
var existsFilter = Terrasoft.createExistsFilter("[Activity:Account].Id", subFilters)
esq.filters.addItem(existsFilter);
 
// now use the results how you would any ESQ
// in this case a list of accounts where an activity exists with a certain owner
esq.getEntityCollection(function(result) {
	if (result.success) {
		Terrasoft.each(result.collection.getItems(), function(entity) {
			var name = entity.values.Name;
			var id = entity.values.Id;
			console.log(name, id);
		}, this);
	}
}, this);

This is the same as this: 

Ryan

Thank you for that. I think I should now be able to shave a few machine cycles off by implementing the correct query operator.

 

I have to admit I didn't fully understand the advanced filter 'exists' operator until posting this question and finding this post which gives the SQL equivalent of an ESQ 'createExistsFilter(columnPath)' filter.  The Creatio exists operator essentially implements a SQL EXISTS operator with a correlated subquery.  The column path using a reverse connection sets up a join to another table with the option of adding more filters to the subquery.

Show all comments
Filtering
Filters
detail
display
7.18

Hello community,

I am trying to apply a default filter to a detail from the client side. The filter works fine using a function declared in the filterMethod property of the detail. The problem with this approach is that the filter that I applied is not visible.

The task implementation must have the following display.

Is there a way to show the filter that I applied from the client side (js) like the example above.

Thank you!

Like 0

Like

1 comments

Hello,

 

Thanks for reaching out.

 

We double-checked your request and found that such functionality cannot be implemented neither by basic nor by development tools.

 

Best regards,

Anastasiia 

Show all comments

Hi,

I'm trying to display a maximum date column on a detail list, but need to filter the column by a different column.

For example: On the project page I have a detail for 'Participating schools'. I want to display for each participating school record the maximum of the [ account calendar ] [ start date ] (account calendar is a detail of the school) but want to filter to only semester equals the project's semester. 

I don't see a custom way to filter with a field on the detail setup, I can only filter with a value. 

Any idea how I can do 'semester = Project.semester'?

I'm happy to to also try some coding solutions, if you can tell me where I can find the detail setup code.

Thanks,

Chani

Like 0

Like

1 comments

Hello Chani,



In order to achieve your business task, we recommend creating aggregate columns for each semester by Start date. Then you will be able to choose the needed value, 



Best regards,

Bogdan

Show all comments

Dear Team

 

It would be helpful in the object filter/business process filter to have an option to filter a record exactly on a specific given number of days from a condition similar to a condition where we check for eg:

 

field “A” = Today

 

Rather than having following days/previous days because when we add any of these options it picks up the records in between the no of days condition also

 

Filed “a” = Following days “180”

It filters out record from today to 180th day, instead we would require a filter option which picks exactly the record for the 180th day.

 

This not only helps in the object filter, it also helps in the business process, in case if there are more records in object and to filter out 180th day record it really becomes difficult by using the following days / previous days option. Specific to the number of days mentioned would be simpler and easy to filter the record.

 

Thanks in advance!

3 comments

Dear Amirtha, 



Thank you for sharing this idea. 

We will pass it our R&D team.



Kind regards,

Roman

Currently we use such a filtration

Hi,

 

Is there any update on having the ability to choose a specific amount of days in the future or past to filter on? The previous days and following days filters are quite confusing.

Show all comments

Hi community,

 

In the following example I have this case :

 

 

How can I do to, for example, get the name of the Customer (which obviously is an account) ? I don't want only the informations displayed in the box but I want to have access to all the informations of the "Account" section. How to do this ?

 

I've tried something like this :

 

 

But it doesn't work. When put "Id" instead of "Account.Name" it works and prints the Id of the opportunity in an information dialog box. 

 

I obviously want to get the name of the account that is directly related to the opportunity where the button is.

 

Any idea on how to do this ? This doesn't seem to be complicated, i've tried many things but nothing worked. 

 

P.S. I'm on the opportunitySectionV2 source code.

 

Many thanks,

Jonathan

Like 0

Like

0 comments
Show all comments
Filters
Marketing_Creatio

In contacts section, while setting up new folder, I want to apply filter to exclude contacts from another existing folder. How to do it? Please help.

Like 0

Like

2 comments

Hello Saurabh,

 

Unfortunately, there is no in-built functionality to do so. Although you can add a lookup column to Contacts based on the Contact Folder lookup and choose the folder to which the contact belongs. After that, you will be able to achieve your goal. 

You can also add any column to differentiate contacts and add them to different folders based on the value in the column.

 

Best regards,

Max.

Dear Surabh,

 

I actually was able to find a way to do just what you need!

 

You need to set up the filter the following way:

Best regards,

Max.

Show all comments
dashboard
Filters
Studio_Creatio
7.17

Hi Everyone,

I want to show the filter field always like this, do you guys have any solution?

Like 1

Like

3 comments

Hello,



Regarding your first filter on the picture - once filter for Class of Business is added to the section, the assigned value would be fixed despite of jumping to other sections in Creatio, since it is stored in SysProfileData table.    

In order to add your second quick filter to the [Premium Register] section, you should create a replacing schema of the [Premium Register] section and add your quick filter which will filter records by Policy Number.  

You can find useful information regarding adding quick filters to the section on this link https://academy.creatio.com/docs/developer/elements_and_components/basi…

 





Best Regards,

Tetiana Bakai

Tetiana Bakai,

 

do you have idea for quick filter for string type?

Fransetya Alfi Syahrin,

 

Please provide the business task that is followed by creating such a functionality? To activate a string type filter two buttons should be pressed:

 

1) "Filter" context menu

2) "Add filter" button

 

Also why can't you create a dynamic folder in case you need to access some filtered data on a regular basis?

 

If you need to develop such functionality you need to look at the showSimpleFilterEdit function and its call in the CustomFilterViewModelV2. We don't have a ready solution and you need to develop it on your own.

 

Best regards,

Oscar

Show all comments

Hello,

 

I can take severall roles in my opportunities. I can be a contact, presales, responsilbe, etc.

 

How can I create a list with all my opportunities.

Thanks

Like 0

Like

1 comments

Hello, 

 

You can create a new dynamic folder in the Opportunity section, that will be populated with records based on the set filter:

1. Add filter condition based on the opportunity stage and choose all the needed stages from the list. 

2. Add a group of conditions based on your "role": owner/contact/etc. 

For an example, you can refer to the attached screenshot.



 

Best regards, 

Anastasiia

Show all comments