Filter custom entity

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • homeempire
    Senior Member
    • Sep 2014
    • 181

    Filter custom entity

    Hi.

    I have custom entity: "Kredyty". I want to filter this entity so I edit:


    /application/Espo/Modules/Crm/SelectManagers/Kredyty.php:
    Code:
    namespace Espo\Modules\Crm\SelectManagers;
    
    class Kredyty extends \Espo\Core\SelectManagers\Base
    {
        protected function filterAktualne(&$result)
        {
            $result['whereClause'][] = array(
                
                'status=' => ['Oferta', 'Wniosek', 'Analiza', 'Odroczenie', 'Decyzja pozytywna', 'Umowa podpisana']
            );
        }
        
        protected function filterArchiwum(&$result)
        {
            $result['whereClause'][] = array(
                
                'status=' => ['Decyzja negatywna', 'Rezygnacja klienta', 'Wypłacony']
            );
        }
    
     }

    and /custom/Espo/Custom/Resources/metadata/clientDefs/Kredyty.json:
    Code:
    {
        "controller": "Controllers.Record",
        "boolFilterList": [
            "onlyMy"
        ],
        "filterList": [
          {
             "name":"Aktualne",
             "style": "success"
          },
          {
             "name":"Archiwum",
             "style": "danger"
          }
        
       ]
    }

    These filters apears in CRM but when I click on one nothings happens. Why?
  • yuri
    Member
    • Mar 2014
    • 8453

    #2
    Try to make first letter lower case.
    "name":"aktualne"
    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

    • homeempire
      Senior Member
      • Sep 2014
      • 181

      #3
      It doesn't help. And I know that it can be "Aktualne" because i have it on other site and it's working.
      Any other idea?

      Comment

      • yuri
        Member
        • Mar 2014
        • 8453

        #4
        Maybe your entity doesn't belong to Crm module. Try to move your class to custom or proper module.
        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

        • homeempire
          Senior Member
          • Sep 2014
          • 181

          #5
          Thank You
          Last edited by homeempire; 08-30-2016, 06:34 PM.

          Comment

          Working...