Hi,

 

Is it possible to filter the 'Search' results in the Contact Container so it only shows the contacts that are belonging to the account that is selected above?

 

Currently I have the full list of contacts displayed when i open the dropdown. (see images)

 

Many Thanks

 

Tom

 

 

Like 0

Like

1 comments

Hi!



Unfortunately, this cannot be done now. We have registered a feature request to our R&D team and added your case to it. This feature may be included in future releases. 



Best regards,

Anton

Show all comments

Dear colleagues

 

To implement a process who automatically cancel activities not started from more than "XX" hours from the hour they are created, I filter all activities which meet some another conditions and Created on < Previous hours XX.

 

I want to use a System setting if customer want to change the XX hours, in the future, and not need to touch the process. 

 

Is there any way possible to replace 10 by a formula like 

Created on < Previous hours [#System setting.SLATasks#] (in the filter condition)?

 

Thanks in advance

 

Best regards

Julio Falcón

Like 0

Like

3 comments
Best reply

What I did is to create a Date/Time parameter called FechaSLA with this value 

[#System variable.Current Time and Date#].AddHours( -[#System setting.SLA MDA's#] )

and in the filter use Created On < FechaSLA , that's all!

 

Thanks

Hello Julio,

You can create a date/time param to use in the condition and then populate the param with a formula like this:

[#System variable.Current Time and Date#].AddHours(-10)

This formula takes the current date/time and adds a negative 10 hours  (which is subtracting 10 hours). The value of 10 could be a int param so it's flexible the amount of hours subtracted. 

Ryan

Ryan Farley,

Thanks Ryan...

 

How come I didn't see it? hahaha :-(

 

Regards

Julio

What I did is to create a Date/Time parameter called FechaSLA with this value 

[#System variable.Current Time and Date#].AddHours( -[#System setting.SLA MDA's#] )

and in the filter use Created On < FechaSLA , that's all!

 

Thanks

Show all comments

Hello,



I am experiencing problem when adding filter to filtergroup via add addItem.

Error states, filter.on is not a function.



Here's the esq:

const esq = Ext.create("Terrasoft.EntitySchemaQuery", {
	rootSchemaName: entitySchemaName
});
esq.addMacrosColumn(Terrasoft.QueryMacrosType.PRIMARY_COLUMN, "value");
esq.addMacrosColumn(Terrasoft.QueryMacrosType.PRIMARY_DISPLAY_COLUMN, "displayValue");
if (filterRules) {
	const filterDataFilters = Terrasoft.deserialize(filterRules);
	var filterGroup = new this.Terrasoft.createFilterGroup();
	filterGroup.logicalOperation = this.Terrasoft.LogicalOperatorType.AND;
	filterGroup.addItem(filterDataFilters); // <-- error filter.on is not a function
	esq.filters.addItem(filterGroup);
}

Here's the filter, which I saved in DB:

'{"items":{"59552fe0-df1d-41fc-b4c8-0e24dc86254e":{"filterType":1,"comparisonType":12,"isEnabled":true,"trimDateTimeParameterToDate":false,"leftExpression":{"expressionType":0,"columnPath":"Title"},"rightExpression":{"expressionType":2,"parameter":{"dataValueType":1,"value":"test"}}},"c3e0782f-a3f2-4e21-ad86-88801d5085ac":{"filterType":2,"comparisonType":2,"isEnabled":true,"trimDateTimeParameterToDate":false,"leftExpression":{"expressionType":0,"columnPath":"Account"},"isNull":false}},"logicalOperation":0,"isEnabled":true,"filterType":6,"rootSchemaName":"Opportunity"}'

Here's the error message:

 

Anyone have any idea about this problem?



Regards,

Lem

Like 0

Like

1 comments
Best reply

Silly me!



I already fixed it, my json is missing way more data than required.

Silly me!



I already fixed it, my json is missing way more data than required.

Show all comments

Hello,



Is there a way or documentation on how to implement/display like the Advance Filter  on a custom tab?









I want to display the filtering function in a custom tab, then save the filtering result to Database and use it in some logic.

Like 0

Like

3 comments

Hello, Solem!

If I've understood you right and you want to add custom options to the advanced filter on custom page - please, read the following article 

https://community.creatio.com/questions/example-createexistsfiltercolumnpath

In another case - please, specify the question and give more details with screenshots if possible.

Best regards, Anhelina!

Anhelina,

 



I appreciate you answering my question.

What I want is to display a filtering in a custom tab, then save the filtering result to Database.

 

Solem Khan Abdusalam,

 

Hello,

 

Unfortunately there is no example of adding such a filter to a custom tab (along with the action handler that will save the selected result in the database). We already have a task for our R&D team to add such a possibility to add advanced filters to details on the page. We will also inform them about this question to prioritize the task.

 

Thank you for helping us in making the app better!

Show all comments

I have a problem filtering a lookup filed using Freedom UI.

The issue here:

The first lookup filed linked to the Contact entity

The second lookup filed's entity Account, contains a field "SMPrimaryAccountOwner" and it should be equal to the first filed value. 



Here is the filter:

 

{
				request: "crt.LoadDataRequest",
				handler: async (request, next) => {
					// filter the contact lookup for the account
					debugger;
					if(request.dataSourceName !== "LookupAttribute_emk4fel_List_DS") {
						return await next?.handle(request);
					}
 
 
					const account = await request.$context.LookupAttribute_r6avpkd;
					if (account) {
						const filter = new sdk.FilterGroup();
						await filter.addSchemaColumnFilterWithParameter(sdk.ComparisonType.Equal, "SMPrimaryAccountOwner.Id", account.value);
 
						// note, these lines are only needed due to an issue with filters in Creatio-DevKit SDK
						// expected to be fixed in Creatio 8.1
						//const newFilter = Object.assign({}, filter);
						//newFilter.items = filter.items;
 
						request.parameters.push({
							type: sdk.ModelParameterType.Filter,
							value: filter
						});
					}
 
					return await next?.handle(request);
 
				}
			}



And here is the error on the console:



 

Maybe anyone here had the same issue.

Like 0

Like

2 comments
Best reply

Try changing to just the field "SMPrimaryAccountOwner" and not the ".Id" part at the end.

await filter.addSchemaColumnFilterWithParameter(sdk.ComparisonType.Equal, "SMPrimaryAccountOwner", account.value);

Also, even if you're on 8.1 the commented lines are necessary - the issue that works around was *not* fixed in 8.1.

Ryan

Try changing to just the field "SMPrimaryAccountOwner" and not the ".Id" part at the end.

await filter.addSchemaColumnFilterWithParameter(sdk.ComparisonType.Equal, "SMPrimaryAccountOwner", account.value);

Also, even if you're on 8.1 the commented lines are necessary - the issue that works around was *not* fixed in 8.1.

Ryan

Try adding the filter for "SMPrimaryAccountOwner" and not "SMPrimaryAccountOwner.Id", as in: 

await filter.addSchemaColumnFilterWithParameter(sdk.ComparisonType.Equal, "SMPrimaryAccountOwner", account.value);

Also, the workaround that is commented out is still needed in 8.1. It was not fixed in 8.1.

Ryan

Show all comments

Hi,

I've created a custom FreedomUI page for AccountAddress object. I'd like to implement some kind of automation for two lookup fields: Country and Region. It consists of two parts:

1. When I choose a region from list, the country should be set to region's country. For example, if I choose Texas region, I expect that country will be set to United States

2. When I choose a country, regions lookup should display only these regions, which are connected with selected country.

I haven't any problem with implementation of the first part. But the second part doesn't work I expected. I use handler for crt.LoadDataRequest to append a filter parameter when loading regions list. The problem is that this handler runs only once, at first list load. It doesn't execute when I change country, although I trigger such request from other handler (crt.HandleViewModelAttributeChangeRequest). Here is the crucial of my code:

{
	request: 'crt.LoadDataRequest',
	handler: async (request, next) => {
        if (request.dataSourceName === 'Region_List_DS') {
	        const predefinedFilter = await request.$context.Region_filter;
	        request.parameters.push({
		        type: "filter",
		        value: predefinedFilter
	        });
        }
 
		return await next?.handle(request);
	}
},
{
	request: 'crt.HandleViewModelAttributeChangeRequest',
	handler: async (request, next) => {
        if (request.attributeName === 'EvCountry' && request.value?.value != null && (request.oldValue?.value == null || request.value.value !== request.oldValue.value)) {
			const countryId = request.value?.value;
            request.$context.EvRegion_filter = {
				"items": {
					"1954b2e1-ea91-4014-b785-cda17020595c": {
						"items": {
							"CustomFilters": {
								"items": {
									"customFilterCountry_Region_1664cb4d-2690-48d6-bcdf-0c8075824efa": {
										"filterType": 1,
										"comparisonType": 3,
										"isEnabled": true,
										"trimDateTimeParameterToDate": false,
										"leftExpression": {
											"expressionType": 0,
											"columnPath": "Country"
										},
										"rightExpression": {
											"expressionType": 2,
											"parameter": {
												"dataValueType": 10,
												"value": countryId
											}
										}
									}
								},
								"logicalOperation": 0,
								"isEnabled": true,
								"filterType": 6
							}
						},
						"logicalOperation": 0,
						"isEnabled": true,
						"filterType": 6
					}
				},
				"logicalOperation": 0,
				"isEnabled": true,
				"filterType": 6
			};
 
			const handlerChain = sdk.HandlerChainService.instance;
			const result = await handlerChain.process({
				type: "crt.LoadDataRequest",
				$context: request.$context,
				config: {
					loadType: "load"
				},
				dataSourceName: "EvRegion_List_DS",
			});
		}
 
		return next?.handle(request);
	}
}

The problem is that my trigger (handlerChain.process call) doesn't run crt.LoadDataRequest, and result variable contains full, unfiltered list of regions.

Like 1

Like

5 comments

Hello,

 

Thank you for the code and description!

 

We've verified the issue and discussed it with our core R&D team: in 8.0.9 there will be a possibility to add filtration business rules using wizard capabilities in Freedom UI. Please wait until this version is released and use this rule type to create dynamic filtration in Freedom UI interface.

Oleg Drobina,

as filtration business rules do not cover all cases of filtration, when can we wait for trigger fix?

We have tested in 8.0.9 and have the same issue as described



Thank you!

Vladimir

Vladimir Sokolov,

 

indeed filtration rules (along with static filtering business rules) don't cover all cases, but most of them. As for the list loading and the LoadDataRequest - in 8.1.0 there will be new "filterAttributes" attribute added for each list of each data source with the boolean "loadOnChange" property that will allow dynamic setup of filters in the lists (including combobox). It will look like this:

"filterAttributes": [
					{
						"loadOnChange": true,
						"name": "AccountItems_FILTER_BY_ACTIVE_ROWS"
					}

where AccountItems_FILTER_BY_ACTIVE_ROWS will be the filter itself. So in 8.1.0 all filtration cases should be covered by this functionality.

Hello,

 

Glad to inform you that in 8.1.1 we've added the possibility to use custom filters in page schema handlers when working with SDK. So you can upgrade your apps and you will be able to use custom filtration on the page.

Hi Oleg,

 

Do you have the code / Procedure to do this in 8.1.1 ?

Show all comments

Hi Team,

 

We have a scenario to display only few products when the add (+) icon is clicked in the Product detail of Order section. When the add record is clicked a product catalogue is displayed.



Required Filter Scenario:

All the products that belong to a particular price list alone should be shown in the product catalogue list along with additional columns in the Product Price table is also taken into consideration for the filter.

 

Only Products that match the below conditions should be displayed in the list,

  1. Particular Price List.
  2. Particular column value in Product Price (Custom Column ex: UsrProductGrade).
  3. Particular column value in Product Price (Custom Column ex: UsrIsActive).

 

Required Default Value in UOM Lookup:

When the product catalogue page is opened the UOM (Unit of Measure) field should be set with a particular lookup value by default available in that lookup & set to locked (not editable).

 

Filter out/Remove/Hide all product's base prices in the product catalogue

Don't want any base price in the product price and not needed to show this record in the product catalogue.

 

Below is the setup for the above case:

Step 1: Filter applied in ProductSelectionSchema (Not Working)

 

getProductInBasePriceListEsq: function(basePriceList) {
			var basePriceListProductEsq = this.getBaseESQ("Product");
 
			var customPriceList = Terrasoft.SysSettings.cachedSettings.UsrcustomPriceList;
 
			var productPricePrefix = "[ProductPrice:Product:Id].";
			basePriceListProductEsq.rowCount = 40;
			var productGrade = this.sandbox.publish("productGradeMessage", null, "productFilterGradeMessage");
 
			basePriceListProductEsq.addColumn("Price", "ProductPrice");
			basePriceListProductEsq.addColumn(productPricePrefix + "Price", "Price");
			basePriceListProductEsq.addColumn(productPricePrefix + "Currency", "Currency");
			basePriceListProductEsq.addColumn(productPricePrefix + "Tax", "Tax");
			basePriceListProductEsq.addColumn(productPricePrefix + "Tax.Percent", "DiscountTax");
			basePriceListProductEsq.addColumn(productPricePrefix + "PriceList", "PriceList");
			basePriceListProductEsq.addColumn(productPricePrefix + "UsrProductGrade", "UsrProductGrade");
			basePriceListProductEsq.addColumn(productPricePrefix + "UsrIsActive", "UsrIsActive");
 
			//Additional Filters for Grade and Active product
			basePriceListProductEsq.filters.addItem(this.Terrasoft.createColumnFilterWithParameter(
				this.Terrasoft.ComparisonType.EQUAL, productPricePrefix + "PriceList.Id", customPriceList));	
			basePriceListProductEsq.filters.addItem(this.Terrasoft.createColumnFilterWithParameter(
				this.Terrasoft.ComparisonType.EQUAL, productPricePrefix + "UsrProductGrade", productGrade.value));
			basePriceListProductEsq.filters.addItem(this.Terrasoft.createColumnFilterWithParameter(
				this.Terrasoft.ComparisonType.EQUAL, productPricePrefix + "UsrIsActive", true));
 
			this.applyAdditionalFilters(basePriceListProductEsq);
			this.initializePageableOptions(basePriceListProductEsq);
			basePriceListProductEsq.filters.addItem(
				this.Terrasoft.createColumnFilterWithParameter(this.Terrasoft.ComparisonType.EQUAL,
					"IsArchive", false));
			return basePriceListProductEsq;
		},

 

Step 2:  Made the value "Base" inactive from pricelist lookup (still all the products base price list is shown).



 

None of the filters applied is working. Instead, it shows the products that are matched with new pricelist value in the pricelist lookup for other products which doesn't has new value it takes the base price list and displays.



Any insight on this would be highly appreciated!

 

 

BR,

Bhoobalan Palanivelu.

Like 0

Like

8 comments

Hello Bhoobalan,

 

Maybe it's much easier to modify the logic of the onGridDataLoaded method in the ProductSelectionSchema module and modify the final gridData collection that will be displayed? When the grid data is loaded in the context of execution of this method you can check all records loaded to this selection page one by one and check whether they have the needed price list (and if so leave it in the grid data, othewise remove this record from grid data) and also you can apply modifications to such records (like setting the default unit of measure). Because creating custom ESQ that is asynchronous can result in inconsistent behavior and also to errors when loading the grid.

Oleg Drobina,

 

It would be of great help if you could assist with a simple sample for this case in the Product selection schema.



And how to set a default value for a Unit Of Measure field and make it locked?



BR,

BBhoobalan Palanivelu.

Bhoobalan Palanivelu,

 

to lock the "Unit Of Measure" column you need to override the getEditableColumns method in the ProductSelectionSchema module. For example like in the example below:

getEditableColumns: function() {
				let parentColumns = this.callParent(arguments);
				if (this.Terrasoft.isCurrentUserSsp()) {
					parentColumns = this.Terrasoft.without(parentColumns, "Price");
				}
				parentColumns = this.Terrasoft.without(parentColumns, "Unit");
				return parentColumns;
			},

As a result you won't be able to modify the Unit Of Measure" column.

 

As for settings the removing some results from the grid: for example I have two products in the selection window: one has the price of 900 and another one has the price of 100. I want to remove the product with the price that is less or equal 100. To do so we override the onGridDataLoaded method in the following manner:

onGridDataLoaded: function(response) {
				if (!response.success || response.queryResults.length === 0) {
					return;
				}
				var dataCollection = this.Ext.create("Terrasoft.Collection");
				this.prepareResponseCollection(dataCollection, response);
				var lastValue = null;
				var gridData = this.getGridData();
				var canLoadData = false;
				for (var i=0; i &lt; dataCollection.getItems().length; i++) {
					var price = dataCollection.getItems()[i].values.Price;
					if (price &lt;= 100) {
						dataCollection.removeByIndex(i);
					}
				}
				if (dataCollection.getCount()) {
					var lastItemIndex = dataCollection.getCount() - 1;
					var lastItem = dataCollection.getByIndex(lastItemIndex);
					var products = gridData.collection.filterBy(
						function(res) {
							var resId = res.get("RealRecordId");
							return resId === lastItem.get("RealRecordId");
						}
					);
					if ((products.length &lt;= 0)) {
						lastValue = lastItem.get("Name");
						canLoadData = true;
					}
				}
				this.set("sortColumnLastValue", lastValue);
				if (canLoadData) {
					gridData.loadAll(dataCollection);
				}
				this._updateGridCaptionContainerVisibility();
				this.set("GridData", gridData);
			},

the main body of the method is a basic body and the customization here goes at:

for (var i=0; i &lt; dataCollection.getItems().length; i++) {
					var price = dataCollection.getItems()[i].values.Price;
					if (price &lt;= 100) {
						dataCollection.removeByIndex(i);
					}
				}

where we prepare received data collection for further basic processing. So you can test this approach on your side.

Oleg Drobina,



Appreciate the detailed response!



How shall we set some particular/specific value as the default value to this Unit Of Measure (UOM) lookup field?



We have locked it in getEditableColumns() and how does the logic go by to set a default value?



Best Regards,

Bhoobalan Palanivelu.

Bhoobalan Palanivelu,

 

this is the custmization inside the onGridDataLoaded method, but additionally to the previous removal of records we will need to set the value for the "Unit of measure" column for each record after the unnecessary records are removed from the dataCollection.

Oleg Drobina,



Thanks for the response!



Still, the filter remains not to work even with the logic of removing values from the collection in OnGridDataLoaded().

 

The code gets executed but still, the products with 0 prices are shown in the Grid. please find the below references.

 

Logic es executing:

 

All records are again loaded into the Grid 

 

 

BR,

Bhoobalan Palanivelu.

Bhoobalan Palanivelu,

 

I've checked and indeed it happens in case there are two records with the price = 0 that are located one after another in the dataCollection (for example the 0 item has 0 price and the 1st item has 0 price). It happens because the logic removes an item with the 0 index (i=0), as a result an item with the 1 index is moved to the 0 index (because the original item with 0 index was deleted) and since we are in a cycle the code goes to check the item with the 1 index and skips that item that moved to the 0 index.

 

Perhaps this dataCollection should be processed in terms of a separate collection and then this custom collection should be placed into the dataCollection.

Oleg Drobina,



Yes, Now we were able to remove all the products where "Price = 0".



Also, how to make a filter to the grid products?

Unable to set the Default Value for the UOM field.



BR,

Bhoobalan Palanivelu.

Show all comments

Hello!

 

I added my custom parameters, Client Category & Standard Destination in for each Product and I would like to filter by them. 

 

 

In the Opportunity page I have the "Product" field.

 

Does anybody know how I can filter the product based on the Custom Parameters that I have? I 

 

Thank you!

Like 0

Like

1 comments

Hello!

 

Here are a few points that should be helpful:

 

1. The product catalog is not displayed in Opportunity. There is no logic yet that would automatically fill the Opportunity page from the product catalog according to the given parameters in the Opportunity. You would need to configure a business process, you can use the product selection functionality. For this, there is an action in the "Products" section or a pre-configured page that can be used in the business process.



2. If you still need to set up a filter on the product catalog section, see the example here:

3. In Sales there are the following details: "Parameter" on the "Opportunity details" tab, "Products" on the "Products" tab. These details work according to the contents of the "Customer needs" lookup. If the value of such needs is selected for Opportunity, for which the parameters are preset - they will be automatically added to this detail. If products are added there, they will be available for selection in the "Opportunity Product" detail. You can modify this lookup in the Leads section (it works the same way for leads), in the "Setup customer needs" action.

Show all comments

Hello community,

 

I was wondering if there is any way in which I can filter the values in a lookup, based on a column that is not in the detail in which the lookup is. Is that possible? How can I achieve this?

Thank you 

Like 0

Like

1 comments

Hello Maria, 

 

We'd suggest to check the solution provided in this post:

https://community.creatio.com/questions/lookup-different-quick-filter-o…



Let us know in case of any further questions. 

Best regards,

Anastasiia

Show all comments

Hi community,

 

As an OOTB feature of Creatio, when using the "simple" filter on a lookup, a maximum number of 15 entries are displayed.

How is it possible, via some coding (or at least I doubt it will be with code), to unlock this maximum number of entries when filtering ?

 

Is there a way to dynamically display all the entries of a lookup or is it only possible to display it with a constant value ?

 

Many thanks for the help provided.

 

Best regards,

Jonathan

 

Like 0

Like

2 comments

Hello Jonathan,

 

There is a restriction in the system on the number of fields displayed in the quick filter for this field (15 records). 



If you want to choose all possible variants of the lookup you can use an advanced filter that doesn't have restrictions on the number of records (you will see a pop-up window with all options to choose from). The number of records displayed by the quick filter can be changed only via development and there is no possibility to change this amount with the help of out-of-the-box tools of the instance (there is no appropriate system setting or lookup value to change).



We already have a query registered for our responsible R&D team to consider implementing this functionality in future versions of the Creatio application. I will assign your case to this project in order to increase its priority.

 

Best regards,

Anastasiia

Hi Jonathan

 

I haven't testing this but this should work:

 

This setting should be added to the section page schema in the init method. Here is an example for the ContactSectionV2 replacing schema:

 

define("ContactSectionV2", [], function() {

    return {

        entitySchemaName: "Contact",

        methods: {

            init: function () {

Terrasoft.SysSettings.lookupRowCount = 60;

this.callParent(arguments);

            }

        }

    };

});

 

Refreshing / reloading the page will set this setting back to the default value, so that's why we need to put this in the init method. When the page will load again, lookupRowCount will be set to the desired value again.

 

Jeremy

Show all comments