Announcement

Collapse
No announcement yet.

getSelectFilters not showing value on UI

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • 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

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

    This post should be in bug reports.

    Comment


    • #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


      • #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...
        X