Hello Community,

We want a default quick filter to be applied always to a detail (AccountContactsDetailV2) in the Account section. This filter should be permanent like this:

This academy article is only appliable for Sections and not details

https://academy.creatio.com/documents/technic-sdk/7-13/adding-quick-fil…

All the best

Sasori

Like 2

Like

3 comments

I am not sure how to add the default values (so the user can remove them) since it is a per-user thing, but if you always needed the filter values set for the detail (and not allow the user to remove them) you could filter the detail using ESQ filters as shown here: https://customerfx.com/article/filtering-a-detail-list-in-creatio-forme…

Ryan

Will quick filter component in Freedom UI 8.0.8 allow this maybe ?



(Beta in 8.0.7: Quick filters. It is now possible to apply custom filters to one or more Freedom UI lists on a page using the [ Quick filter ] component. )

Ryan Farley,

Hi Ryan. The idea is to apply the quick filter for the detail (like for sections)

Through this coding applied in AccountContactDetailV2_:

onRender: function() {
				this.callParent(arguments);
				this.set("IsDetailFilterVisible", true);
				this.set("IsFilterAdded", true);
				this.set("IsShortFilterFieldsVisible", true);
 
			},
			getFilterDefaultColumnName: function() {
				return "Left";
			},

I have managed to bring the detail in this state (printscreen) every time the pages renders:

Do you know if it is possible to put also a default value, when the detail renders ?

Thanks,

Sasori

Show all comments

Hello,



we need to improve lookup selection for several section. The main idea is to reduce quantity of records for selection, but still give user to search through full list.



We tried to use multiLookup feature to give 2 options: "All products" and "Active products" (like we select Account/Contact in the Order)



 

"UsrProductLookup": {
    "dataValueType": Terrasoft.DataValueType.LOOKUP,
    "type": Terrasoft.ViewModelColumnType.VIRTUAL_COLUMN,
    "multiLookupColumns": ["UsrProductA", "UsrProductB"],
    "caption": "Product",
    "onChange": "setProduct"
},
"UsrProductA": {
    "dataValueType": Terrasoft.DataValueType.LOOKUP,
    "type": Terrasoft.ViewModelColumnType.VIRTUAL_COLUMN,
    "isLookup": true,
    "referenceSchemaName": "Product"
},
"UsrProductB": {
    "dataValueType": Terrasoft.DataValueType.LOOKUP,
    "type": Terrasoft.ViewModelColumnType.VIRTUAL_COLUMN,
    "isLookup": true,
    "referenceSchemaName": "Product"
}

But then got an error, that we cannot use the same object for both lookups. 



message: Item with key "Product" Already exists 

date: Tue Oct 18 2022 02:01:40 GMT+0400 

moduleId: CardModuleV2_02b6b083-3cfa-4daf-a93c-632cb2420805_AccountPageV2_LookupPage

moduleName: MultiLookupModule



How is it possible to use multiLookup for this purpose? 

Or what alternative is for user-friendly quick filter in Lookup window?



Thank you.

Vladimir

Like 0

Like

4 comments

Hello Vladimir,



Please find the information about up filtering of lookup field values on a record page in this article

 

Bogdan,

thank you for link to Creatio basics.



But combination of quick filters (tabs in this case) gives possibility to search by second condition - by product name.



If you use search in lookup for one criteria (e.g. Inactive), you cannot search by another criteria - name. 

Besides, search in lookup requires much more actions (more than 4 clicks) comparing to 1 click in quick filter



That's why we are searching for smart solution



Kind regards,

Vladimir

Vladimir Sokolov,

 

We recommend creating a business rule on the page depending on a particular checkbox: if the checkbox is activated, then display the field in which the code filtering is implemented, if deactivated - hide the column with filtering in the code and show the column without filtering on the page.

 

You might need two columns so that you control the visibility of one depending on a particular checkbox. It can be achieved by using a business rule. 

 

Please try using the filters described in the article above for one column, and for the other one - do not apply the filters from the code (so that all Lookup records are displayed). This way, you may not use code elements as you just implement the business rule - filtering on the page.

Alla Blinova,

Thank you. Yes, we use solution with field and business rules, but customer should open lookup, search, then close lookup, change checkbox, open lookup again... 



Sometimes it can be acceptable, sometimes not. That's why we are looking for better option - to allow user change lookup filtration directly in lookup window. It can be a checkbox in lookup window or several predefined tabs. Maybe it sounds like an idea for future versions, maybe it is possible implement with current one



Kind regards,

Vladimir

Show all comments

Hi Team,



I would like to change the week value in calendar activity.

By default we have Sunday to Monday, i need it to be displayed as Monday to Sunday.



Please find the attachment below,







we see that it is loaded from these modules FixedFilterViewModelV2,FixedFilterViewV2



in FixedFilterViewV2, getPeriodFixedButtonsViewConfig(Filtername) function generates the calendar icon buttons for current day, current week, current month filter and they are binded to "SetCurrentDayPeriod", "SetCurrentWeekPeriod" and month menu button collection correspondingly.

 

function getPeriodFixedButtonsViewConfig(filterName) {
			var localizableStrings = resources.localizableStrings;
			var localizableImages = resources.localizableImages;
			var dayButton = getFixedButtonBaseConfig({
				click: {bindTo: "setCurrentDayPeriod"},
				hint: localizableStrings.TodayCaption,
				imageConfig: localizableImages.DayPeriodButtonImage,
				markerValue: "day",
				classes: {
					wrapperClass: ["day-period-fixed-filter-wrapper-class"],
					imageClass: ["period-fixed-filter-image-class"]
				},
				visible: {bindTo: "dayButtonVisible"}
			});
			var weekButton = getFixedButtonBaseConfig({
				click: {bindTo: "setCurrentWeekPeriod"},
				hint: localizableStrings.CurrentWeekCaption,
				imageConfig: localizableImages.WeekPeriodButtonImage,
				markerValue: "week",
				classes: {
					wrapperClass: ["day-period-fixed-filter-wrapper-class"],
					imageClass: ["period-fixed-filter-image-class"]
				},
				visible: {bindTo: "weekButtonVisible"}
			});
			var monthButton = getFixedButtonBaseConfig({
				imageConfig: localizableImages.MonthPeriodButtonImage,
				hint: localizableStrings.SelectPeriodCaption,
				markerValue: "month",
				classes: {
					imageClass: ["period-fixed-filter-image-class"]
				},
				visible: {bindTo: "monthButtonVisible"}
			});
			monthButton.menu = {
				items: [{
					className: "Terrasoft.MenuItem",
					caption: localizableStrings.YesterdayCaption,
					click: {bindTo: "setPeriod"},
					tag: filterName + "_Yesterday"
				}, {
					className: "Terrasoft.MenuItem",
					caption: localizableStrings.TodayCaption,
					click: {bindTo: "setPeriod"},
					tag: filterName + "_Today"
				}, {
					className: "Terrasoft.MenuItem",
					caption: localizableStrings.TomorrowCaption,
					click: {bindTo: "setPeriod"},
					tag: filterName + "_Tomorrow"
				}, {
					className: "Terrasoft.MenuSeparator"
				}, {
					className: "Terrasoft.MenuItem",
					caption: localizableStrings.PastWeekCaption,
					click: {bindTo: "setPeriod"},
					tag: filterName + "_PastWeek"
				}, {
					className: "Terrasoft.MenuItem",
					caption: localizableStrings.CurrentWeekCaption,
					click: {bindTo: "setPeriod"},
					tag: filterName + "_CurrentWeek"
				}, {
					className: "Terrasoft.MenuItem",
					caption: localizableStrings.NextWeekCaption,
					click: {bindTo: "setPeriod"},
					tag: filterName + "_NextWeek"
				}, {
					className: "Terrasoft.MenuSeparator"
				}, {
					className: "Terrasoft.MenuItem",
					caption: localizableStrings.PastMonthCaption,
					click: {bindTo: "setPeriod"},
					tag: filterName + "_PastMonth"
				}, {
					className: "Terrasoft.MenuItem",
					caption: localizableStrings.CurrentMonthCaption,
					click: {bindTo: "setPeriod"},
					tag: filterName + "_CurrentMonth"
				}, {
					className: "Terrasoft.MenuItem",
					caption: localizableStrings.NextMonthCaption,
					click: {bindTo: "setPeriod"},
					tag: filterName + "_NextMonth"
				}]
			};
			return [dayButton, weekButton, monthButton];
		}

 

In FixedFilterViewModelV2 we see the below functions

 

        function setCurrentDayPeriod() {
			this.setPeriod("PeriodFilter_Today");
		}
 
		function setCurrentWeekPeriod() {
			this.setPeriod("PeriodFilter_CurrentWeek");
		}
 
		function setPeriod(tag) {
			if (!tag) {
				return;
			}
			var indexOfSeparator = tag.lastIndexOf("_");
			if (indexOfSeparator === -1) {
				return;
			}
			var filterName = tag.substring(0, indexOfSeparator);
			var periodName = tag.substring(indexOfSeparator + 1);
			var periodFilterConfig;
			Terrasoft.each(this.config.filters, function(filterConfig) {
				if (filterConfig.name === filterName) {
					periodFilterConfig = this.getPeriodFilterConfig(filterConfig);
				}
			}, this);
			if (!periodFilterConfig) {
				return;
			}
			var startDate = new Date();
			var dueDate;
			switch (periodName) {
				case "Yesterday":
					startDate = Terrasoft.startOfDay(Ext.Date.add(startDate, "d", -1));
					dueDate = Terrasoft.endOfDay(startDate);
					break;
				case "Tomorrow":
					startDate = Terrasoft.startOfDay(Ext.Date.add(startDate, "d", 1));
					dueDate = Terrasoft.endOfDay(startDate);
					break;
				case "PastWeek":
					startDate = Terrasoft.startOfWeek(Ext.Date.add(startDate, "d", -7));
					dueDate = Terrasoft.endOfWeek(startDate);
					break;
				case "CurrentWeek":
					startDate = Terrasoft.startOfWeek(startDate);
					dueDate = Terrasoft.endOfWeek(startDate);
					break;
				case "NextWeek":
					startDate = Terrasoft.startOfWeek(Ext.Date.add(startDate, "d", 7));
					dueDate = Terrasoft.endOfWeek(startDate);
					break;
				case "PastMonth":
					startDate = Terrasoft.startOfMonth(Ext.Date.add(startDate, "mo", -1));
					dueDate = Terrasoft.endOfMonth(startDate);
					break;
				case "CurrentMonth":
					startDate = Terrasoft.startOfMonth(startDate);
					dueDate = Terrasoft.endOfMonth(startDate);
					break;
				case "NextMonth":
					startDate = Terrasoft.startOfMonth(Ext.Date.add(startDate, "mo", 1));
					dueDate = Terrasoft.endOfMonth(startDate);
					break;
				default:
					startDate = Terrasoft.startOfDay(startDate);
					dueDate = Terrasoft.endOfDay(startDate);
					break;
			}
			this.suspendUpdate = true;
			this.set(periodFilterConfig.startDateColumnName, startDate);
			this.set(periodFilterConfig.dueDateColumnName, dueDate);
			this.suspendUpdate = false;
			if (this.filterChanged) {
				this.filterChanged();
			}
		}

In SetPeriod() function we call Terrasoft.startOfWeek & Terrasoft.endOfWeek based on Switch Case, which is responsible for sunday to Saturday filter display (calculations).



In DateUtils.js, we see the below

Terrasoft.utils.date.startOfWeek = function(dateValue) {
	var dateDiff = dateValue.getDay() + (1 - Terrasoft.Resources.CultureSettings.startDay);
	dateDiff = dateDiff ? 1 - dateDiff : -6;
	return Terrasoft.startOfDay(Ext.Date.add(dateValue, Ext.Date.DAY, dateDiff));
};
 
 
Terrasoft.utils.date.endOfWeek = function(dateValue) {
	var dateDiff = dateValue.getDay()  + (1 - Terrasoft.Resources.CultureSettings.startDay);
	dateDiff = dateDiff ? 7 - dateDiff : dateDiff;
	return Terrasoft.endOfDay(Ext.Date.add(dateValue, Ext.Date.DAY, dateDiff));
};





Please guide on how to replace or extend these modules and achieve a week value from "Sunday to Saturday into Monday to Sunday".



Note:

we could not replace these modules (FixedFilterViewModelV2,FixedFilterViewV2)

 by using "Replacing client Module", if we do so we get below error,

Please guide on how to extend and where to consume the extended module and procedure.







Thanks in Advance!

 





Regards,

Bhoobalan P.

Like 0

Like

5 comments

Hi Bhoobalan,

 

The beginning of the week is connected to the system user localization and as you correctly pointed the main logic is stored in the DateUtils.js file. The only way to modify this logic is to modify the content of two functions: startOfWeek and endOfWeek in the following manner:

Terrasoft.utils.date.startOfWeek = function(dateValue) {
    var dateDiff = dateValue.getDay() + (Terrasoft.Resources.CultureSettings.startDay);
    dateDiff = dateDiff ? 1 - dateDiff : -6;
    return Terrasoft.startOfDay(Ext.Date.add(dateValue, Ext.Date.DAY, dateDiff));
};
 
...
 
Terrasoft.utils.date.endOfWeek = function(dateValue) {
	var dateDiff = dateValue.getDay()  + (Terrasoft.Resources.CultureSettings.startDay);
	dateDiff = dateDiff ? 7 - dateDiff : dateDiff;
	return Terrasoft.endOfDay(Ext.Date.add(dateValue, Ext.Date.DAY, dateDiff));
};

Once done the application should be restarted, the application pool recycled and the Redis flushed. As a result the week will start on Monday as needed.

 

Best regards,

Oscar

Please also note that you won't be able to do that from the application UI and it should be done directly in the file (located at root_app_path\Terrasoft.WebApp\Resources\ui\Terrasoft\utils\common directory). If you want to do this in the cloud-based app you need to provide us with the file, directory and application name where this should be done.

 

UPD: logic described here won't work in the cloud based apps because of the bundling service in the cloud.

 

Best regards.

Oscar

And also you need to delete browser cookies for the website and clean cache in the browser so changes could be applied in the browser.

 

Best regards,

Oscar

Oscar Dylan,

Thanks much!

Hello Oleg Drobina,

 

I have indeed followed all the steps below but no changes have been reflected on the date calendar. Have you updated the procedure ever since ? 

 

Thanks,

Show all comments

Hi. I'd like to have a Dashboard with additional Quick filters. The standard Pipeline Dashboard comes with a date-picker Quick-filter.

I'd like the standard Dashboard, with a By Owner, Quick filter.

In the chapter about the Sales Pipeline Dashboard in the Academy, there is a note about Quick filters at the very bottom of the article. But I can't figure out how to add quick filters to the Pipeline Dashboard.

https://academy.bpmonline.com/documents/base/7-13/sales-pipeline-dashbo…

https://academy.bpmonline.com/documents/base/7-13/quick-filter

Like 0

Like

1 comments

Dear Julius,

You can add quick filter block using the following article: https://academy.bpmonline.com/documents/technic-sdk/7-13/adding-quick-f…

You may also inspect already existing filter in the Pipelines to understand how it should look like for "Owner" or inspect Activity section since it has the same quick filter. 

Show all comments