Question

Hi Team ,

 

Is there a way to add fixed filters to detail (PFA)

 

I have already tried the below link . 

https://academy.bpmonline.com/documents/technic-sdk/7-13/adding-quick-filter-block-section

 

Regards,

Sethuraghav N

Like 1

Like

2 comments

Hello,

 

You can take an example of the filter from the Timeline detail. The example can be found in TimelineFiltersSchema detail.

 

Best regards,

Bogdan

Hi Sethuraghav,

 

Did you manage to implement the Fixed Filters on the detail? If so, can you please explain me how did you do it. Because, I didn't understand the Bogdan's solution.

 

Best Regards,

Pedro Pinheiro

Show all comments

Hi Team,

 

Kindly advice on how to block the mulitiple fixed filter  as attached .

 

Regards,

Sethuraghav N

Like 0

Like

3 comments

Hello,

 

Can you please specify your business task?

Do you want to prevent users from adding multiple single filters on the page?

 

Best regards,

Bogdan

 Yes Bogdan Spasibov, we need to restrict user in adding the multiple filters in a calendar page. Only one filter should be selected at a time.

 

 

HI SathishKumar,

 

There is the option to change filter behavior; however, Creatio R&D team highly disrecommend you implementing such a filter and can provide only theoretical instructions.

 

Firstly, please note that the filter you've mentioned is implemented as an old module functioning through the whole system, not the Activity/Calendar section only. Thus, to avoid affecting all filters of your platform, you need to create your custom one and call it from the replacing client schema module. 

 

The main filter loader is located at the "BaseDataView", the "loadFiltersModule" method. You need to replace the "ActivitySectionV2" and write there your own "loadFiltersModule" method that will re-write the original one from the "BaseDataView". 

 

Then, please create a new module at the Configuration:

 

define("UsrixedFilterViewModelV2", ["FixedFilterViewModelV2"],
	function(fixedFilter) {       
        function generate(config) {
            var result = fixedFilter.generate(config)
            result.methods.oldaddNonPeriodFilterValue = result.methods.addNonPeriodFilterValue;
            result.methods.addNonPeriodFilterValue =  function (tag, simpleFilterValue) {
                var filters = this.get(this.getSelectedLookupValuesPropertyName(tag));
                filters.clear();
                this.oldaddNonPeriodFilterValue(tag, simpleFilterValue);
            };
            return result;
        }
		return {
			generate: generate
		};
	});

 

Below the detailed description step by step. The "fixedFilter" is the old model.

var result = fixedFilter.generate(config)

This code calls a standard out-of-the-box filter.

result.methods.oldaddNonPeriodFilterValue = result.methods.addNonPeriodFilterValue;

Here please write the logic you need:

result.methods.addNonPeriodFilterValue =  function (tag, simpleFilterValue) {
                var filters = this.get(this.getSelectedLookupValuesPropertyName(tag));
                filters.clear();
                this.oldaddNonPeriodFilterValue(tag, simpleFilterValue);
            };

 

 

Regards, 

Anastasiia

Show all comments

Hi All,

 

Is there a way to call a function to set the default value for the fixed filter ?

 

I need to write a ESQ and set the value here .

 

 

Regards,

Sethuraghav N

 

Like 0

Like

1 comments

Hello,

 

Please check the example in this Community Post. It explains how to set default filtering conditions in the Account section by the Category field.

Please let us know if this helps!

 

Best regards,

Bogdan S.

Show all comments

Hi Team,

 

I want hide the fixed filters in activity section (PFA) based on a condition . Is there a way to do it ?

 

Regards,

Sethuraghav N

Like 0

Like

2 comments

Hello Sethuraghav,



You may try to remove these filters: 

define("ActivitySectionV2", [], function() {
    return {
        entitySchemaName: "Activity",
        methods: {
            initFixedFiltersConfig: function () {
                var fixedFilterConfig = {
                    entitySchema: this.entitySchema,
                    filters: []
                };
                this.set("FixedFilterConfig", fixedFilterConfig);
            },
            getParticipants: function() {
                var quickFilterModuleId = this.getQuickFilterModuleId();
                var owners = this.sandbox.publish("GetFixedFilter", {filterName: "Owner"},
                    [quickFilterModuleId]);
                var participants = [];
                if (!Terrasoft.isEmptyObject(owners)) {
                    owners.forEach(function(item) {
                        if (item.value !== this.Terrasoft.SysValue.CURRENT_USER_CONTACT.value) {
                            participants.push(item);
                        }
                    });
                }
                return participants;
            }
        }
    };
});

There are more details described in this Academy Article.

 

Best regards,

Bogdan S

 

Bogdan Spasibov, can we do this based on a condition . I want to make this filter based on condition 

 

Show all comments