filter for second view?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • elbowprogrammer
    Member
    • Jan 2016
    • 58

    filter for second view?

    In quotes entity, I changed the view from products to case/matter. I added a filter based on the account in the quotes entity. I created a method to create a view for another entity, so when users listens to case/matter model, it pops up another view which I created. the issue is, i'm unable to create a filter for the second view based on the case/matter.
    PHP Code:
    if(model_case.get('id'){
    filterCase = {
    case: {
    type:'equals',
    field:'id',
      value:model_case.get('id',
      valueName:model_case.get('name')
    };
    } 
    
    The code above didn't work. Then I utilized the getmodelfactory function to grab the parentId and the parentType, but still was unsuccessful.
    PHP Code:
      var filterCase = null;
      if(model_case.get('id')){
      this.getModelFactory().create(Call,function(zmodel){
      zmodel.fetch().done(function(){
      if(model_case.get('id')) {
      filterCase = {
      case: {
      type: 'equals',
      field: 'parentId',
      value: zmodel.get('parentId'),
      valueName: zmodel.get('parentName')
      }
      };
      }
      }.bind(this));
      },this);
      } 
    
  • yuri
    Member
    • Mar 2014
    • 8478

    #2
    Call should be a string

    this.getModelFactory().create('Call',function(zmodel){
    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

    • elbowprogrammer
      Member
      • Jan 2016
      • 58

      #3
      My apologies for not adding quotations around Call. In my code it had the string quotations, and it didn't work. I manage to resolve the issue anyway.
      Last edited by elbowprogrammer; 03-02-2016, 02:44 PM.

      Comment

      Working...