getSelectFilters not showing value on UI

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • rabii
    Active Community Member
    • Jun 2016
    • 1250

    getSelectFilters not showing value on UI


    I have a relationship in the account entity one to many (account parent => subsidiaries) and i have a multi-enum field (accountType labeled as Company Type) on the account with values (Client - Accountant - Introducer), i have created a custom view for the (account parent) field so that when i select parent account i want to chose only from accounts that have accountType of Client. Everything works fine so far and the custom field works fine however i am struggling to get the value (Client) select on the accountType (Company Type) whne the list is show: below the code for my custom field

    Code:
    Espo.define('custom:views/account/fields/account-parent', 'views/fields/link', function (Dep) {
    
    return Dep.extend({
    
    getSelectFilters: function () {
    return {
    'accountType': {
    type: 'arrayAnyOf',
    attribute: 'accountType',
    value: ["Client"],
    }
    };
    },
    
    });
    });
    If this a bug for multi-enum field or am i missing something on the getSelectFilters method? by the way none of the other type works for multi-enum field like (equals / in / is ) they all don't work for multi-enum field. attached a screenshot. Is there any way just to make sure the value set in the getSelectFilters is reflected on the UI. screenshot show that the code works and filter only brings accounts of type (Client) just missing that value.

    thanks
    Attached Files
    Rabii
    Web Dev
  • yuri
    Member
    • Mar 2014
    • 8453

    #2
    Check the multi-enum field view fetchSearch method to know what data you need to fill.

    This post should be in bug reports.
    If you find EspoCRM good, we would greatly appreciate if you could give the project a star on GitHub. We believe our work truly deserves more recognition. Thanks.

    Comment

    • rabii
      Active Community Member
      • Jun 2016
      • 1250

      #3
      Thanks yuri i have search for the method fetchSearch within client/src/views/fields/multi-enum.js but couldn't find any method there as fetchSearch. am i looking in the right place ?

      thanks
      Rabii
      Web Dev

      Comment

      • rabii
        Active Community Member
        • Jun 2016
        • 1250

        #4
        Thanks yuri i found method on array.js view and i have found the missing part, code below works fine:

        Code:
        Espo.define('custom:views/account/fields/account-parent', 'views/fields/link', function (Dep) {
        
        return Dep.extend({
        
        getSelectFilters: function () {
             var valueList = ['Client'];
             return {
                'accountType': {
                     type: 'arrayAnyOf',
                     value: valueList,
                     data: {
                       type: 'anyOf',
                       valueList: valueList,
                    }
               }
           };
        },
        
        });
        });
        Thanks for your help much appreciated
        Rabii
        Web Dev

        Comment

        Working...