FreedomUI
filter
lookup
Sales_Creatio
8.0

Dear,

We are currently moving from classicUI to freedomUI and I m not able to do a simple filter on a lookup.

I want to filter a contact lookup of the account page. I only want to display the account contacts.

So in the account page business rules i did :

But the lookup is not filter

What do i miss ?

Is it because there is no condition ?

Thank you in advance,

Nicolas

 

Like 0

Like

4 comments
Best reply

Yes, you have to populate the condition part. You can create an always true condition as a workaround (true == true).

Yes, you have to populate the condition part. You can create an always true condition as a workaround (true == true).

Fyi this is fixed in 8.2.2. Release notes mention: Streamlined business rule setup. "Dynamic filter" and "Set value" business rules no longer need conditions to work

i had to add a condition then the rules works. i added if id is filled in.

I managed to filter a contact lookup using a business rule based on the contact's account name. For another contact lookup, I need to filter the contact ID to match the page's account ID.
can this filter be implemented as a business rule ?
after several days of research, I still don't see how to perform this filter without code...
Can someone help me please ?

Show all comments
lookup
filter
FreedomUI
code
Filters
Sales_Creatio
8.0

I am trying to add a filter on the lookup owner based on the account field, but the filter is not working. Does anyone have an idea why?

Thanks!

handlers: /**SCHEMA_HANDLERS*/[
        {
            request: "crt.LoadDataRequest",
            handler: async (request, next) => {
                // filter the contact lookup for the account
                             
                if(request.dataSourceName !== "LookupAttribute_85sj3qr_List_DS") {
                    return await next?.handle(request);
                }
         
                // get the account                  
                const account = await request.$context.Parameter_q8l08xk;
                if (account) {
                    const filter = new sdk.FilterGroup();
                    await filter.addSchemaColumnFilterWithParameter(sdk.ComparisonType.Equal, "Account", account.value);
         
                    
                    const newFilter = Object.assign({}, filter);
                    newFilter.items = filter.items;
         
                    request.parameters.push({
                        type: "filter",
                        value: newFilter
                    });
                }
                             
                return await next?.handle(request);
            }
        }
            
        ]/**SCHEMA_HANDLERS*/,

Like 0

Like

2 comments

First, enable debug mode by executing the following in the browser console:

See https://customerfx.com/article/debugging-client-side-code-in-creatio-fo…

Once enabled, open the code for the page and set some breakpoints. Is a dataSourceName for "LookupAttribute_85sj3qr_List_DS" getting triggered? Maybe the name is wrong?

Is request.$context.Parameter_q8l08xk correctly retrieving the account?

Ryan

Everything looks Correct , and the issue was that I forgot to add the SDK "@creatio-devkit/common" to the page .
Thank You 

Show all comments
Filtering
LookupFilter
look up filters
Filters
filter
quick-filter
Sales_Creatio

How to filtering lookup with static filter that i have 1 object that is relation to contact and account, and i want to filter if the account is has been added to the object then the account not display in the lookup

Like 2

Like

1 comments

The necessary filtering can be implemented in section page source code. In order to do that you will have to write the handler for crt.LoadDataRequest request that appears when the lookup is opened.

Here is the example of the implementation:
 

/**SCHEMA_MODEL_CONFIG_DIFF*/,
	handlers: /**SCHEMA_HANDLERS*/[
		{
			request: "crt.LoadDataRequest",
			handler: async (request, next) => { 
				if(request.dataSourceName !== "PDS_UsrDoctor_sm2qg7w_List_DS") {
					return await next?.handle(request);
				}
				console.log('Lookup Load Data...');
				const cardModel = await sdk.Model.create("UsrHospitalVisitCardV3");
 
				// now load the records and provide the filters             
				const cards = await cardModel.load({
					attributes: ["UsrDoctor"]
				});
				console.log(cards);
 
				if (cards) {
					const filter = new sdk.FilterGroup();
					filter.logicalOperation = sdk.LogicalOperatorType.Or;
					cards.forEach(async (card) => {
						if(card.UsrDoctor && card.UsrDoctor.value){
							await filter.addSchemaColumnFilterWithParameter(sdk.ComparisonType.Equal, "Id", card.UsrDoctor.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: "filter",
						value: newFilter
					});
				}
 
				return await next?.handle(request);
			}
		}
	]/**SCHEMA_HANDLERS*/

 
In the example above "PDS_UsrDoctor_sm2qg7w_List_DS" is the name of the lookup that has to be filtered and "UsrHospitalVisitCardV3" is the object that contains that lookup and which records we should check.

You can also find some additional details and useful information in the articles:
https://customerfx.com/article/dynamically-filtering-a-lookup-on-a-creatio-freedom-ui-page/
https://customerfx.com/article/querying-data-using-filter-conditions-via-the-model-class-equivalent-to-enityschemaquery-in-a-creatio-freedom-ui-page/

Show all comments
8.2
filter
look up filters
FreedomUI
FilterLookup_FreedomUI_FormPage
Studio_Creatio
8.0

Hello Community,

 

I'm trying to use the "Apply Filter" function to filter a lookup value based on three parameters. The business rule works correctly when adding a new record and copy record; however, when editing an existing record, only one filter is being triggered (marked).

 

 

Has anyone encountered this issue, and is there a solution to ensure all filters are applied when editing a record?

Like 0

Like

2 comments

Hello!

Please check the following points:

  1. Verify how the values are populated on the page and make sure that all conditions in the business rules match the actual fields and events on the page.
  2. If the values are populated by a process, please note that the standard business rules may not be triggered correctly because they expect client-side user interaction.
  3. For testing, we recommend splitting the rules — try applying one condition at a time to make sure the first filter works as expected. Once you confirm that, add the next condition. This incremental approach will help you identify which condition may not be working.

If you need, we can help you review the configuration or provide best practices for this scenario.

Alona Dolya,

Hello, thanks for the response.
We ended up implementing a filter in the client-side code. It took more effort, but it works as expected.

Show all comments
odata4
filter
datetime
Sales_Creatio
8.0

Hello @Community,

 

I am using Creatio API OData4 to get the data from Creatio Object Collection.

I wanted to filter the data base on date and time. Is there a way to get only last 3 months data with Odata4?

Like 0

Like

1 comments

Hello,

 

You can use the following filtering:
$filter=CreatedOn ge 2024-08-05T00:00:00Z

 

https://documenter.getpostman.com/view/10204500/SztHX5Qb?version=latest

Show all comments
filter
FreedomUI
Javascript
Service_Creatio
8.0

Hi, 

 

I need to set a complex filter for a grid. How do I create a filter in JS and set it to a list in a page in freedom?

 

Best regards, 

 

Javier 

Like 0

Like

1 comments

Have you tried adding a crt.LoadDataRequest handler to dump request.dataSourceName out to the console to see if you can determine the name of the dataSourceName attriubute the list uses - and that it does fire that request? I assume it triggers this request when it get's it's data - similar to how lookups do, see https://customerfx.com/article/dynamically-filtering-a-lookup-on-a-creatio-freedom-ui-page/

Assuming it does and once you know the name of the dataSourceName it uses for the request you could add the conditions.

Alternatively, I believe you can add the filter conditions directly in the datasource in the viewModelConfigDiff, but you'd need to know the attribute name used in that scenario as well. Something like https://academy.creatio.com/docs/8.x/dev/development-on-creatio-platform/front-end-development/freedom-ui/data-sources/data-processing#title-2438-3

Ryan

Show all comments
How
to
prevent
a
list
from
being
populated
when
there
is
no
filter
applied

I have a list page, and its data source is a spesefic object we have created.  above the list table there is a search element. What i want is when there is no filter applied the list table should be empty and, when any filter is applied then it should show only the matching resluts. How can i achieve this? What now happening is it is showing all of the existing records, but when i wanted to set up a business rule I could not find any option to access search element.

Like 0

Like

3 comments

And also, when the filter is cleaerd the list should again be empty as there is no filter applied

Zulaykho,

Clear the list isn't an easy task and needs a development team to be involved. Instead, you can prevent the list load by showing the Error message to the customer:

{
	request: "crt.SearchFilterColumnsGroupsRequest",
	handler: async (request, next) => {
		const searchValueLenIsZero = request?.value?.length == 0;
		const isEmptySearchValue = request?.value?.trim().length == 0;
		if (searchValueLenIsZero || isEmptySearchValue) {
			Terrasoft.showErrorMessage("There is no filter");
               } else {
                 await next?.handle(request);
               }
	}
}

Best regards,

Anhelina!

Anhelina,

Thank you a lot for your response! 

Show all comments
handler
JS
filter
Studio_Creatio

deleted

Like 0

Like

2 comments

Hello Agnieszka,

To fix the issue you should change the property: 

1) sdk.ComparisonType.LessOrEqual to sdk.ComparisonType.Less_or_equal   

2) sdk.ComparisonType.GreaterOrEqual to sdk.ComparisonType.Greater_or_equal

Good practice is to check if the property exists with the console:

Anhelina,

Thank you

Show all comments
filter
opportunityproductdetailv2

Good Day,

I have been trying to add a filter on Product Lookup on OpportunityProductDetailV2 but does not seem to work. Anyone knows what my problem is? Here's my current code.

Thank You
 

 

define("OpportunityProductDetailV2", [], function() {
	return {
		entitySchemaName: "OpportunityProductInterest",
		attributes: {},
		methods: {
			prepareProductLookup: function(config) {
              debugger;
                var filterGroup = this.Terrasoft.createFilterGroup();
                filterGroup.add("ProductNameFilter", this.Terrasoft.createColumnFilterWithParameter(
                    this.Terrasoft.ComparisonType.CONTAIN, "Name", "Test"
                ));
 
                config.filters.add("customProductFilter", filterGroup);
                this.callParent(arguments); // Call the parent method if needed
            }
		},
		diff: /**SCHEMA_DIFF*/ [
			{
                "operation": "merge",
                "name": "Product",  // Lookup field to which the filter is applied
                "values": {
                    "bindTo": "Product",
                    "controlConfig": {
                        "prepareList": {
                            "bindTo": "prepareProductLookup" // Binding the method to prepare lookup with filters
                        }
                    }
                }
            }
		]/**SCHEMA_DIFF*/
	};
});
Like 0

Like

1 comments

Hi everyone, 

you can ignore this, turns out I was adding the custom code to the wrong page. It should be on OpportunityProductPageV2 instead of the one above.

Thanks

Show all comments
quick-filter
filter
dashboard
8.0

Hello, 
I want to make a dashboard where you can quickly select a month by which the pivot table will be filtered. How can I do that?

Like 0

Like

1 comments
Best reply

Hello,


Unfortunately, in the current settings, direct quick filtering of pivot tables is not available. To create a dashboard where you can quickly filter a pivot table by selecting a month, you typically need to use the quick filter.

1. Add the pivot table to your dashboard as usual.
2. Use the "How to associate with section data" feature to connect your pivot table to a data source from a section.



3. Instead of filtering directly within the pivot table, you can apply filters to the section. The pivot table will then automatically update to reflect the filtered data.

Hello,


Unfortunately, in the current settings, direct quick filtering of pivot tables is not available. To create a dashboard where you can quickly filter a pivot table by selecting a month, you typically need to use the quick filter.

1. Add the pivot table to your dashboard as usual.
2. Use the "How to associate with section data" feature to connect your pivot table to a data source from a section.



3. Instead of filtering directly within the pivot table, you can apply filters to the section. The pivot table will then automatically update to reflect the filtered data.

Show all comments