Custom filter on account link field

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • csc-solution
    Junior Member
    • Nov 2021
    • 10

    Custom filter on account link field

    Hello everyone,

    is there a possibility in EspoCRM to add a custom select filter ("Typ" "AnyOf" "Partner") to a linked account field. The filter should be active only when selecting an account with this field (see Screenshot).


    Thanks in advance,

    Regards,
    Thomas
  • dimyy
    Active Community Member
    • Jun 2018
    • 569

    #2
    If I correct understand you can make 'partner' field custom view like this:

    Code:
    Espo.define('custom:views/opportunity/fields/knife', 'views/fields/link', function (Dep) {
    
    console.log('custom knife field view');
    
    return Dep.extend({
    
    getSelectFilters: function () {
    
    return {
    'width': {
    attribute: 'width',
    type: 'between',
    value: [17,22]
    }
    };
    },
    
    getSelectBoolFilterList: function() {
    return ['correct', this.model.get('id')];
    },
    
    });
    
    });
    In the 'Firmen' entityDef code like this :

    Code:
     "knife": {
    "type": "link",
    "view": "custom:views/opportunity/fields/knife"
    },

    Comment

    • csc-solution
      Junior Member
      • Nov 2021
      • 10

      #3
      Thanks dimyy, now it works perfect.

      Comment

      Working...