Hello All!

 

I have made multiple attempts at filtering a dashboard list through code, but have been unsuccessful in my attempts. I'm assuming the process would be the same for custom filtering any list view, but I am specifically working with a List in a dashboard. The default filters do not work in my case, and I am looking for guidance on how to dynamically filter the records that are displayed in a list on a dashboard. I have already looked through numerous other posts as well as Freedom UI related videos and found multiple examples of filtering other components such as lookups, but nothing seems to carry over to the list view. Please help! A simple example would be immensely helpful in pointing me in the right direction.

 

Thank you!

Chris

Like 1

Like

3 comments

Unfortunately, we don't have ready-made examples of implementing such filtering. However, you can build such a filter using the following code as an example:

 



 

"attributes": {

..

                "DataGrid_d7k1ikp": {

                    "isCollection": true,

                    "modelConfig": {

                        "path": "DataGrid_d7k1ikpDS",

                        "filterAttributes": [

                            {

                                "loadOnChange": true,

                                "name": "DataGrid_d7k1ikp_PredefinedFilter"

                            }

                        ]

                    },

 

 

DataGrid_d7k1ikp_PredefinedFilter leads us to the attributes:

 

"DataGrid_d7k1ikp_PredefinedFilter": {

                    "value": {

                        "items": {

                            "a2376c0c-0b3f-451a-9085-0a65ae58bab8": {

                                "filterType": 4,

                                "comparisonType": 3,

                                "isEnabled": true,

                                "trimDateTimeParameterToDate": false,

                                "leftExpression": {

                                    "expressionType": 0,

                                    "columnPath": "Account"

                                },

                                "isAggregative": false,

                                "dataValueType": 10,

                                "referenceSchemaName": "Account",

                                "rightExpressions": [

                                    {

                                        "expressionType": 2,

                                        "parameter": {

                                            "dataValueType": 10,

 

...

 

If you need to build a dynamic filter, you should look in this direction. Create a custom attribute, populate it when loading the record (in the LoadDataRequest handler), and use it in the code of the DataGrid_d7k1ikp_PredefinedFilter filter.

If you have doubts about how to correctly construct paths to columns, please follow these steps: navigate to the section with this list, create an advanced filter, find the SelectQuery in the browser's Network tab, and copy the filters from the request body.



Best regards, Pavlo!

Hey Pavlo,

 

Thank you for your guidance and recommendations. Unfortunately they do not seem to work for what I am attempting to implement. The main issue I believe occurring is that the attribute is not being referenced correctly in the predefined filter. I have referenced it in the same way as I have found in other examples("$AttributeName"), but this does not seem to work.

 

If anyone can provide any guidance on how to filter a list dashboard in Freedom UI it would be super helpful! I have attempted many different routes for filtering the list dashboard, but none have worked. I need to add a custom filter through code, as the quick filter does not work for what I need.

 

Thank you in advance!

Chris

Hey Pavlo,

Thank you for your guidance and recommendations. Unfortunately they do not seem to work for what I am attempting to implement. The main issue I believe occurring is that the attribute is not being referenced correctly in the predefined filter. I have referenced it in the same way as I have found in other examples("$AttributeName"), but this does not seem to work.

If anyone can provide any guidance on how to filter a list dashboard in Freedom UI it would be super helpful! I have attempted many different routes for filtering the list dashboard, but none have worked. I need to add a custom filter through code, as the quick filter does not work for what I need.

Thank you in advance!

Chris

Show all comments

Where can i see the Schema details in the Creatio to edit it.

Like 0

Like

1 comments

Hello,

 

In Creatio, you can access the Schema details and make edits in the Configuration section

Show all comments

Hello,

 

We are interested in using the following Marketplace addon: https://marketplace.creatio.com/app/salesup-custom-urls-creatio

However, it requires additional files to be added to the site directory and our instances are cloud-hosted by Creatio.

 

Is possible to request this be set up for us?

 

Thanks

Lewis

Like 0

Like

1 comments

Hello,

 

If any changes should be done to the cloud-based instance, you can contact support team via support@creatio.com with detailed step by step instruction for further assistance. 



Best regards,

Anastasiia

Show all comments

I am trying to process a collection of objects. But I am unsure how to pass the collection from a read data element in a business process to a user task. I am also unsure what parameter type I should use on the user task. Can someone tell me the name of a process/user task in creatio I can look at for an example? Or tell me how I can do this?

Like 0

Like

2 comments

Hello, Josh.

I think you can find an example here 

https://academy.creatio.com/docs/user/bpm_tools/process_elements_refere…

Check the example with CompositeObjectList

Hello, Josh.

Check this article 

https://academy.creatio.com/docs/user/bpm_tools/process_elements_refere…

 

Example you need is CompositeObjectList

Show all comments

We are encountering an error when attempting to set the column value on the lead entity with the following code below. The error message received and the stacktrace are listed below as well. Obviously this is a dictionary error, but I am clearly not adding any items to the column list, and have not set the column value previously. Does anyone have any ideas on what might be happening, or what I could check to make sense of this?

var rawBody = new StreamReader(stream).ReadToEnd();
var val = rawBody.Split('&')
		.Select(keyVal => keyVal.Split('='))
		.ToDictionary(kvp => kvp[0], kvp => Uri.UnescapeDataString(kvp[1]).Replace('+', ' '));
 
var leadSchema = _userConnection.EntitySchemaManager.GetInstanceByName("Lead");
var l = leadSchema.CreateEntity(_userConnection);
l.SetDefColumnValues();
l.SetColumnValue("srcColumnName", val["column_name"]);
 
 
An item with the same key has already been added. 
StackTrace: 
at System.ThrowHelper.ThrowArgumentException(ExceptionResource resource) 
at System.Collections.Generic.Dictionary`2.Insert(TKey key, TValue value, Boolean add) 
at Terrasoft.Core.Entities.EntityColumnValueCollection..ctor(UserConnection userConnection, EntitySchemaColumnCollection columns) in C:\Projects\8.0.4.1870\TSBpm\Src\Lib\Terrasoft.Core\Entities\EntityColumnValue.cs:line 410 
at Terrasoft.Core.Entities.Entity.get_ColumnValues() in C:\Projects\8.0.4.1870\TSBpm\Src\Lib\Terrasoft.Core\Entities\Entity.cs:line 848 
at Terrasoft.Core.Entities.Entity.SetColumnValue(String valueName, Object value) in C:\Projects\8.0.4.1870\TSBpm\Src\Lib\Terrasoft.Core\Entities\Entity.cs:line 3024 

 

Like 0

Like

4 comments
Best reply

Check that your "Lead" object, where the record is modified has no duplicated columns (the error is returned from EntityColumnValueCollection, not in SetColumnValue). Also are you able to add records manually to the "Leads" section? I guess you should get some simillar error on this attempt either. Also if you are using PostgreSQL please:

 

1) Go to the root Web.config

2) Find the maxEntitySchemaNameLength key and modify the value to 63 there

 

This key controls the data reader behaviour and fixes issues of max PostgreSQL items length (table names, column names, etc.) and if your object has several columns with the lenght of name more than 63 symbols this issue can also occur.

I forgot to mention the 'SetDefColumnValues' method call was added after the error message appeared.

Check that your "Lead" object, where the record is modified has no duplicated columns (the error is returned from EntityColumnValueCollection, not in SetColumnValue). Also are you able to add records manually to the "Leads" section? I guess you should get some simillar error on this attempt either. Also if you are using PostgreSQL please:

 

1) Go to the root Web.config

2) Find the maxEntitySchemaNameLength key and modify the value to 63 there

 

This key controls the data reader behaviour and fixes issues of max PostgreSQL items length (table names, column names, etc.) and if your object has several columns with the lenght of name more than 63 symbols this issue can also occur.

Thank you Oleg! Another admin added a column in another package with the same name.

@Oleg, 

 

Do you have any idea why this same message might be happening on the start of any business process? 



I receive the message popup "

"An item with the same key has already been added. " 

 

Thanks

Harry

Show all comments

For creating An Api i was tried to create a webservice to retrive an email from employee section  in creatio.it was published without any errors

below is the following code.

 

namespace Terrasoft.Configuration

{

    using System;

    using System.Configuration;

    using System.ServiceModel;

    using System.ServiceModel.Web;

    using System.ServiceModel.Activation;

    using Terrasoft.Common;

    using Terrasoft.Core;

    using Terrasoft.Web.Common;

    using Terrasoft.Core.Entities; 

    [ServiceContract]

    [AspNetCompatibilityRequirements(RequirementsMode = AspNetCompatibilityRequirementsMode.Required)]

    public class UsrCustomConfigurationService : BaseService {

    

        [OperationContract]

        [WebInvoke(Method = "GET", BodyStyle = WebMessageBodyStyle.Wrapped,

            RequestFormat = WebMessageFormat.Json, ResponseFormat = WebMessageFormat.Json)]

        public string EmployeeDetails(string Name) {

           // Default result.

            var result = " ";

            // The EntitySchemaQuery instance, addressing the Contact database table.

            var esq = new EntitySchemaQuery(UserConnection.EntitySchemaManager, "UsrEmployee");

           

            var Fname = esq.AddColumn("UsrFullName");

            var eid = esq.AddColumn("UsrEmailid");

             var esqFilter = esq.CreateFilterWithParameters(FilterComparisonType.Equal, "UsrFullName",Name);

            esq.Filters.Add(esqFilter);

            // Receiving query results.

            var entities = esq.GetEntityCollection(UserConnection);

            // If condtion the data received.

             if (entities.Count > 0)

            {

                /* Return the "Id" column value of the first query result record. */

                result = entities[0].GetColumnValue("UsrEmailid").ToString();

                /* You can also use this option:

                result = entities[0].GetTypedColumnValue(colId.Name); */

            }

            // Return result.

            return result;

        }

    }

}

Now, I am trying to access the webservice API from postman. But it was giving an error. I was attaching the image for reference. Whether I followed correct procedure or not?

If any other procdures to retrieve data.please,help us.

Like 0

Like

3 comments

Hello Keerthana Yenagandhula

 

I made a similar webservices a few weeks ago.

Here's a Creatio article explaining how to do it:

https://academy.creatio.com/docs/7-18/developer/back_end_development/we…

 

And there is also the walkthrough to test it in Postmain

https://academy.creatio.com/docs/7-18/developer/back_end_development/we…

 

I hope this will help you.

 

Vincent

 

LAVIGNE Vincent,

LAVIGNE Vincent,

In my case, I am facing issue in Postman Issue.could please,help me I am unable to rectify this issue.

Keerthana Yenagandhula,

Hi!

 

Please review all the headers and ensure that the settings are configured correctly.

 

Here is the documentation to get acquainted with:  https://documenter.getpostman.com/view/10204500/SztHX5Qb?version=latest…

 

We will be glad to help with any other questions.

Show all comments

I have tried to compile the cloud environment but i am facing an error can some help me out on how to resolve this error: 

 

File attachments
Like 0

Like

3 comments

Hi!

 

Please try to run the actions 'generate all' and compile the site again.

 

Let us know the result, please!

Alla Blinova,

we are still getting the same error

Hi!

 

The issue is caused by the missing sources of the custom package object. To resolve this issue, we recommend regenerating the sources for the relevant schemas (please see the attached file) ​​​​​​​ and then performing compilation.



To investigate this behavior, we ask you to submit a request to our team via support@creatio.com or the Success Portal. 



We'll need to access the instance remotely in order to help.



Thank you for your cooperation!

Show all comments

Hello team,

 

I have written a script using SEQUENCE & TRIGGERS for PostGres to auto increment the record number. This was a decision taken to avoid writing multiple codes through JS and Server side because we get inputs from a lot of sources - 3rd party integration, manual entry & business process.

 

While our trigger works well, we noticed that using odata, the response returned does not have the auto numbered value, whereas the auto numbering is indeed getting stored in the data base.

 

The question is, does Odata response for POST requests get triggered after all DB triggers are completed or does it happen just before a record is inserted into the DB?



PS: I tried triggers using BEFORE update and it did not work

Like 0

Like

1 comments

Hello,

This question needs to be analyzed mo deeply, but, based on your information, the POST request isn't affected by all the DB triggers and therefore happens before the insert.

Also, a small note, if you have autonumbering both on the JS and Server side than a new number will be generated no matter what is the source of the object (data, business process, etc).

Show all comments

Hi Community, 



Is there anyone who might be able to help me with the code below? I am trying to filter a lookup column, by the value of another lookup column on the same page.

Specifically, my column "PrimaryContact" should be filter Contacts where the "Account" is equal to the "UsrCompanyName" of the same page. 



I've tried many things in the "Value" for rightExpression, but can't seem to get it to work. The rest of the code seems okay because if I add a Guid of an Account to the value, it filters fine. 



Thanks!



 

"LookupAttribute_j53fgnq_List_BusinessRule_Filter": {
					"value": {
						"filterType": 6,
						"isEnabled": true,
						"items": {
							"CustomFilters": {
								"filterType": 6,
								"isEnabled": true,
								"items": {
									"cb855fc4-4526-475a-beea-8e41a7f5a439": {
										"comparisonType": 11,
										"filterType": 1,
										"isEnabled": true,
										"leftExpression": {
											"expressionType": 0,
											"columnPath": "Account"
										},
										"rightExpression": {
											"expressionType": 2,
											"parameter": {
												"dataValueType": 1,
												"value": "$PDS.UsrCompanyName.Id"
											}
										},
										"trimDateTimeParameterToDate": false
									}
								}
							}
						}
					}
				}, 
 

 

Like 2

Like

4 comments
Best reply

Hi Harry,

It would be easier to handle the request for when the lookup requests its data source and then add the filters to that request since you'd have access to page data.

When the lookup is activated (user clicks the dropdown) it sends a crt.LoadDataRequest. You can listen for that and then add the filters there. The request would look something like this: 

handlers: /**SCHEMA_HANDLERS*/[
	{
		request: "crt.LoadDataRequest",
		handler: async (request, next) => {
		    // the data soruce name will be the lookup attribute name + "_List_DS"
			if (request.dataSourceName !== "LookupAttribute_46uzwvy_List_DS") {
				return await next?.handle(request);
			}
 
			// get other page values
			const compId = request.$context.UsrCompanyName.value;
 
			// add filter
			request.parameters.push({
				type: "filter",
				value: {
						"filterType": 6,
						"isEnabled": true,
						"items": {
							"CustomFilters": {
								"filterType": 6,
								"isEnabled": true,
								"items": {
									"cb855fc4-4526-475a-beea-8e41a7f5a439": {
										"comparisonType": 11,
										"filterType": 1,
										"isEnabled": true,
										"leftExpression": {
											"expressionType": 0,
											"columnPath": "Account"
										},
										"rightExpression": {
											"expressionType": 2,
											"parameter": {
												"dataValueType": 1,
												"value": compId
											}
										},
										"trimDateTimeParameterToDate": false
									}
								}
							}
						}
			});
 
			return await next?.handle(request);
		}
	}
]/**SCHEMA_HANDLERS*/,

As a side note, for the filter, I believe something along these lines should work. It's close the working, but the end result request shows in the network tab that the filter key and filter values get added separately to the filters array causing a server error. Hopefully we'll get more details on this sort of thing soon:

(Note, the below doesn't work yet, but sharing it in case someone else gets it to work)

handlers: /**SCHEMA_HANDLERS*/[
	{
		request: "crt.LoadDataRequest",
		handler: async (request, next) => {
		    // data soruce name is lookup attribute + "_List_DS"
			if (request.dataSourceName !== "LookupAttribute_46uzwvy_List_DS") {
				return await next?.handle(request);
			}
 
			let filters = new sdk.FilterGroup();
			filters.addSchemaColumnFilterWithParameter(sdk.ComparisonType.Equal, "Type.Name", "Partner");
 
			// add filter
			request.parameters.push({
				type: sdk.ModelParameterType.Filter,
				value: filters
			});
 
			return await next?.handle(request);
		}
	}
]/**SCHEMA_HANDLERS*/,

Ryan

Hi Harry,

 

In case you doubt about the filtration on the column you can create a test list based on the object of your lookup column and specify the needed filtration there:

and

save the page and open the code. As a result you will see an autogenerated code of the working filtration that then can be applied to the column:

HI Oleg, 



Thank you. This example works well when applying a static filter. However, it seems not to work the same when trying to apply filter by page data. 



Do you have any example how to translate this same method so that I can filter a lookup column by page data? 



Thank you 

Hi Harry,

It would be easier to handle the request for when the lookup requests its data source and then add the filters to that request since you'd have access to page data.

When the lookup is activated (user clicks the dropdown) it sends a crt.LoadDataRequest. You can listen for that and then add the filters there. The request would look something like this: 

handlers: /**SCHEMA_HANDLERS*/[
	{
		request: "crt.LoadDataRequest",
		handler: async (request, next) => {
		    // the data soruce name will be the lookup attribute name + "_List_DS"
			if (request.dataSourceName !== "LookupAttribute_46uzwvy_List_DS") {
				return await next?.handle(request);
			}
 
			// get other page values
			const compId = request.$context.UsrCompanyName.value;
 
			// add filter
			request.parameters.push({
				type: "filter",
				value: {
						"filterType": 6,
						"isEnabled": true,
						"items": {
							"CustomFilters": {
								"filterType": 6,
								"isEnabled": true,
								"items": {
									"cb855fc4-4526-475a-beea-8e41a7f5a439": {
										"comparisonType": 11,
										"filterType": 1,
										"isEnabled": true,
										"leftExpression": {
											"expressionType": 0,
											"columnPath": "Account"
										},
										"rightExpression": {
											"expressionType": 2,
											"parameter": {
												"dataValueType": 1,
												"value": compId
											}
										},
										"trimDateTimeParameterToDate": false
									}
								}
							}
						}
			});
 
			return await next?.handle(request);
		}
	}
]/**SCHEMA_HANDLERS*/,

As a side note, for the filter, I believe something along these lines should work. It's close the working, but the end result request shows in the network tab that the filter key and filter values get added separately to the filters array causing a server error. Hopefully we'll get more details on this sort of thing soon:

(Note, the below doesn't work yet, but sharing it in case someone else gets it to work)

handlers: /**SCHEMA_HANDLERS*/[
	{
		request: "crt.LoadDataRequest",
		handler: async (request, next) => {
		    // data soruce name is lookup attribute + "_List_DS"
			if (request.dataSourceName !== "LookupAttribute_46uzwvy_List_DS") {
				return await next?.handle(request);
			}
 
			let filters = new sdk.FilterGroup();
			filters.addSchemaColumnFilterWithParameter(sdk.ComparisonType.Equal, "Type.Name", "Partner");
 
			// add filter
			request.parameters.push({
				type: sdk.ModelParameterType.Filter,
				value: filters
			});
 
			return await next?.handle(request);
		}
	}
]/**SCHEMA_HANDLERS*/,

Ryan

Thank you, Ryan. That worked perfectly. 

Show all comments

Can we hide a section from a workplace for a certain time frame?

 

Regards

Sivanesan

Like 0

Like

1 comments

Hello,

 

If you need to hide the section for some time for a specific user or group of users/role, you can simply remove the section for the needed time from a Workplace in which the user/group of users or specific user role is working and once needed add it to the Workplace again. 

You may also consider creating a separate Workplace for this user/users so it will be easier to manage. 

However, the user will still be able to access records or a section by a direct link for example, if you need to prevent it, we'd suggest considering changing access rights for the object for the user/user role. 



If we are talking about hiding a section for a specific timeframe, for example from 4 to 5 pm each day, such implementation can be done only by means of additional development. 

 

Best regards,

Yuliya Gritsenko

Show all comments