Question

Facing issue in Section filters

Hi,

 I added a section filters  on status in Order screen. But When i click on status filter i can see the user name option along with the "select status"&"Clear" options. For what reason is the username visible in Status filters ? I have not given any such conditions there. Can you help me out to remove it.

The code snippet in OrderSectionV2 is given below

define("OrderSectionV2", [], function() {

    return {

        entitySchemaName: "Order",

        details: /**SCHEMA_DETAILS*/{}/**SCHEMA_DETAILS*/,

        diff: /**SCHEMA_DIFF*/[]/**SCHEMA_DIFF*/,

        methods: {

         initFixedFiltersConfig: function() {

                var fixedFilterConfig = {

                    entitySchema: this.entitySchema,

                    filters: [

                         {

                            name: "PeriodFilter",

                            caption: this.get("Resources.Strings.PeriodFilterCaption"),

                            dataValueType: this.Terrasoft.DataValueType.DATE,

                            startDate: {

                                columnName: "StartDate",

                                defValue: this.Terrasoft.startOfWeek(new Date())

                            },

                            dueDate: {

                                columnName: "StartDate",

                                defValue: this.Terrasoft.endOfWeek(new Date())

                            }

                        },

                        {

                            name: "Owner",

                            caption: this.get("Resources.Strings.OwnerFilterCaption"),

                            columnName: "Owner",

                            defValue: this.Terrasoft.SysValue.CURRENT_USER_CONTACT,

                            dataValueType: this.Terrasoft.DataValueType.LOOKUP,

                        },

                          

                        {

                            name: "Status",

                            columnName: "Status",

                            caption: this.get("Resources.Strings.StatusFilterCaption"),

                            appendCurrentOrderMenuItem: false,

                            dataValueType: this.Terrasoft.DataValueType.LOOKUP,

                            addNewFilterCaption: this.get("Resources.Strings.SelectStatusCaption"),

                            hint: this.get("Resources.Strings.SelectStatusCaption"),

                            buttonImageConfig: this.get("Resources.Images.SortIcon"),

                        }

                        

                    ]

                };

                this.set("FixedFilterConfig", fixedFilterConfig);

                

            }

        }

    };

});


 

 

Please find the below screen shot.

 

Like 0

Like

3 comments

Hello, the view that is responsible for generating menu items for fixed filter is called "FixedFilterViewV2" more precisely "getMenuButtonItems" method. We can see that appendCurrentContactMenuItem property is checking inside of this method. http://prntscr.com/mqtpy3



So the solution is to add this property to your filter config and set it to false.  I have already modified your code so please feel free to use it.

define("OrderSectionV2", ["BaseFiltersGenerateModule"], function(BaseFiltersGenerateModule) {
    return {
        entitySchemaName: "Order",
        details: /**SCHEMA_DETAILS*/{}/**SCHEMA_DETAILS*/,
        diff: /**SCHEMA_DIFF*/[]/**SCHEMA_DIFF*/,
        methods: {
         initFixedFiltersConfig: function() {
                var fixedFilterConfig = {
                    entitySchema: this.entitySchema,
                    filters: [
                        {
                            name: "Owner",
                            caption: this.get("Resources.Strings.OwnerFilterCaption"),
                            columnName: "Owner",
                            defValue: this.Terrasoft.SysValue.CURRENT_USER_CONTACT,
                            dataValueType: this.Terrasoft.DataValueType.LOOKUP,
                        },
 
                        {
                            name: "Status",
                            columnName: "Status",
                            caption: "Status filter",
                            appendCurrentOrderMenuItem: false,
                            dataValueType: this.Terrasoft.DataValueType.LOOKUP,
                            addNewFilterCaption: "Status filter",
                            hint: "hint caption",
                            appendCurrentContactMenuItem: false,
                            buttonImageConfig: this.get("Resources.Images.SortIcon"),
                        }
 
                    ]
                };
                this.set("FixedFilterConfig", fixedFilterConfig);
 
            }
        }
    };
});

 

Hi Alex_tim,

Thank you. Worked.

Also I have an another question, I want to fix a value for lookup column like in owner filter we are using "defvalue" property. How can this property be used for status filter since this is lookup column.

Sriraksha KS,

You should take a look into "FixedFilterViewV2" and debug it to understand how the menuitems are added to the quick filter.

After debug, you will know how to add menuitems and if it will be necessary, simply override base logic.



Regards,

Alex

Show all comments