Is it possible to sort the quick filter list you get displayed with code in Freedom UI? I can see there is no way to do it through no code currently, but is there a handler that can be overridden to add sorting to the resulting list? Would be very useful in some circumstances. Maybe it will be done on the load data step using crt.LoadDataRequest in some way? Not sure what the config items that would need to be added to the request would be though.

Like 1

Like

3 comments

Hello Harvey,

 

Could you please elaborate on your business task? 

Simply, we need to sort the values displayed in the Quick Filter. In this case it's because the quick filter values correspond to periods in the client's period calendar, and we want to show them in descending order so that the current period is the first item in the list (the values selectable are the ones before the current period, so sorting by name descending would suffice, but it would definitely be useful to have a generalised way of sorting quick filter options).

Harvey,

 

Thank you for clarifying. There is no such OOTB option. However, I've registered the idea in our R&D team backlog for consideration and implementation in future application releases.

 

Thank you for helping us to improve our product. 

Show all comments

Hey, Community

I'm trying to implement a custom filtering logic for quickfiltering of records and to do the same i'm trying to retrieve the value  from the request using the crt.HandleViewModelAttributeChangeRequest. However, the value is being logged as Proxy(nt) due to security reasons.  I'm wondering if there's a way to bypass this limitation in order to obtain the desired result for a custom quick filter. I've attached some photos for reference.



Like 0

Like

4 comments

Hello Vishal,

 

Please clarify what task exactly you want to achieve. Do you need to get the filter itself?

Hey ,Oleg Drobina,

While entering the value in quick filter, dropdown values need to be filter based on first letter. 

For ex: if i enter 5 , it should show the values start with 5. 





thanks,

Vishal

 

vishal,

 

Understood, thank you!

 

As an option you can change the value in the StringColumnSearchComparisonType system setting to 0 and relogin to the app. In this case the filtration will be performed using the "Starts with" option. There is no inbuilt comparisonType property in the component metadata and the system setting is applied to all filters in the system (in this case if you need to use the "contains" option there should either an advanced filter used or use comparison with the % symbol "like '%5%')

Thank you, Oleg Drobina.

 

Show all comments

Hi Community,

 

I have the following requirement where I need to open the ActivitySectionV2 page from a detail schema. More specifically, I've created a button in a custom detail which, when pressed, opens the ActivitySectionV2 page, as you can see in the following image.

 

In addition to opening the page, this button should transfer the records Contact Id from the detail  to the Activity section. Inside the ActivitySectionV2 page, I'll use these values for the QuickFilters of the Employees.

 

 

To achieve this, I tried using messages between modules. And also, loading the section module through the detail but both didn't work. 

 

Detail Schema

messages: {
			"SetActivityFilters": { 
				mode: Terrasoft.MessageMode.BROADCAST,
				direction: Terrasoft.MessageDirectionType.PUBLISH
			}
},
methods: {
openActivities: function(){
 
				var collection = this.get("Collection");
 
				var contactIds = [];
 
				for(var i = 0; i < collection.collection.items.length; i++){
					if(collection.collection.items[i].values.imdContact !== undefined){
						contactIds.push(collection.collection.items[i].values.imdContact.value);
					}
				}
 
				window.console.log(contactIds);
 
 
 
				//Open Activity + Send Contacts
				this.sandbox.publish("SetActivityFilters", contactIds, [this.sandbox.id]);
				this.sandbox.publish("PushHistoryState", {hash: "SectionModuleV2/ActivitySectionV2"});
 
 
				/*this.sandbox.loadModule("SectionModuleV2", {
					renderTo: "centerPanel",
					//id: "SectionModuleV2_ActivitySectionV2",
					instanceConfig: {
						parameters: {
							ContactIds: contactIds 
						},
						schemaName: "ActivitySectionV2",
						isSchemaConfigInitialized: true,
						useHistoryState: true,
						//isSeparateMode: true,
						//entitySchemaName: "Activity",
				  }
		  });*/
}}

 

ActivitySectionV2

 

			messages: {
			         "SetActivityFilters": { 
				          mode: Terrasoft.MessageMode.PTP,
				          direction: Terrasoft.MessageDirectionType.SUBSCRIBE
			         }
		    },		
            methods: {
             init: function(){
				this.callParent(arguments);
				this.sandbox.registerMessages(this.messages);
				this.processMessages();
 
				//window.console.log(this.parameters);
			},
 
			onRender: function(){
				this.callParent(arguments);
			},
 
			processMessages: function() {
				this.sandbox.subscribe("SetActivityFilters", function(result){
 
					window.console.log("'MessageToSubscribe' received" + result);
 
				}, this, ["SectionModuleV2_CaseSection_CardModuleV2_detail_imdSchema54bae29aDetail1d5019a5imdCaseParticipants"]);
			}}

Could you please tell me if there is any other way I can achieve this requirement and what is wrong with my approach.

 

Thanks in Advance.

 

Best Regards,

Pedro Pinheiro

Like 1

Like

3 comments

Hello Pedro,

 

Current code you shared will open the Activity section indeed, but there is no logic in the code that will add values to the quick owner filter. And it's so since it's impossible to do via the scenario you described. Why: because to set such filtration dynamically the addNonPeriodFilterValue method from the FixedFilterViewModelV2 should be called (just check it in the debugger when selecting owner from the lookup inside the filter) and I found no ways of doing that from the init method of ActivitySectionV2. So you need to find other ways of achieving the business task.

Hi Oleg Drobina,

 

Thanks for the response.

 

Currently, to simplify the problem. I'm just trying to fully open the ActivitySection and print the values that are coming from the detail, without applying the filters.

 

To do this I had to change the initial code, because my activity was not receiving the "SetActivityFilters" message. So, what I did was to load the module instead, using the following code:

methods: {
			onActiveRowAction: function(buttonTag, primaryColumnValue) {
				this.mixins.ConfigurationGridUtilitiesV2.onActiveRowAction.call(this, buttonTag, primaryColumnValue);
			},
 
			init: function(){
				this.callParent(arguments);
			},
 
			openActivities: function(){
 
				var collection = this.get("Collection");
 
				var contactIds = [];
 
				for(var i = 0; i &lt; collection.collection.items.length; i++){
					if(collection.collection.items[i].values.imdContact !== undefined){
						contactIds.push(collection.collection.items[i].values.imdContact.value);
					}
				}
 
				window.console.log(contactIds);
 
				this.sandbox.loadModule("SectionModuleV2", {
					renderTo: "centerPanel",
					id: "SectionModuleV2_ActivitySectionV2",
					instanceConfig: {
						parameters: {
							ContactIds: contactIds 
						},
						schemaName: "ActivitySectionV2",
						isSchemaConfigInitialized: true,
						useHistoryState: false,
					}
				});
			}
}

I followed this post in the community to try to implement this https://community.creatio.com/questions/pass-parameters-section

 

When pressing the "Open Activity" button, I get this error and behaviour:

 

After some debbuging, I found that the context does not have the module that I'm trying to load. Maybe, I'm missing some dependencies.

 

 

Could you please help me understand this issue?

 

Once I figure this out, I will check another approach to apply the filters.

 

Thank you.

 

Best Regards,

Pedro Pinheiro

 

 

 

 

 

 

 

 

To pass values from the detail (in my example it was ContractDetailV2) to the ActivitySectionV2:

 

1) In the ContractDetailV2:

onOpenActivityButtonClick: function() {
				this.sandbox.publish("PushHistoryState", {
					hash: "SectionModuleV2/ActivitySectionV2",
					silent: false,
					stateObj: {
						value: "5266908c-f3d1-4c5c-9097-f0dfbdbf900b",
						displayValue: "Email Supervisor"
					}
				});
			}

Here you can pass an array in the "value" property of the stateObj object as well.

 

onOpenActivityButtonClick is a click-handler for the button:

{
                "operation": "insert",
                "name": "OpenActivityButton",
                "parentName": "Detail",
                "propertyName": "tools",
                "values": {
                    "itemType": Terrasoft.ViewItemType.BUTTON,
                    "caption": {"bindTo": "Resources.Strings.OpenActivityButtonCaption"},
                    "click": {"bindTo": "onOpenActivityButtonClick"},
                    "style": Terrasoft.controls.ButtonEnums.style.TRANSPARENT,
                    "enabled": true
                }
            }

 

2) In the ActivitySectionV2:

define("ActivitySectionV2", [], function() {
	return {
		entitySchemaName: "Activity",
		details: /**SCHEMA_DETAILS*/{}/**SCHEMA_DETAILS*/,
		diff: /**SCHEMA_DIFF*/[]/**SCHEMA_DIFF*/,
		methods: {
			init: function() {
				this.callParent(arguments);
				var shouldUpdateFilter = this.checkHistoryState();
				if (shouldUpdateFilter.value &amp;&amp; shouldUpdateFilter.displayValue) {
					var tag = "Owner";
					var row = {
						value: shouldUpdateFilter.value,
						displayValue: shouldUpdateFilter.displayValue
					}
					console.log("Row value: " + row.value + " and Row displayValue: " + row.displayValue);
				}
			},
			checkHistoryState: function() {
				var historyState = this.sandbox.publish("GetHistoryState");
				return historyState?.state;
			}
 
		}
	};
});

As a result you will be able to get passed values in the init method execution:

Show all comments