How to add a custom filter with custom enum field values?

Collapse
X
 
  • Time
  • Show
Clear All
new posts

  • rgcadavos
    replied
    Yes, but in the total count display. It says Total: 2 but it displays only 1 record, though i have sent 2 email on that record. Is my query wrong or is there a need to add $this->limit() ???

    Leave a comment:


  • tanya
    replied
    Hello

    check the path "custom/Espo/Custom/Selectmanagers/Contact.php" (SelectManagers - folder name is case sensitive)
    add enpoint (log some text) to know, if filter is read

    did you add to custom clientDefs filter definition, like

    Code:
    {
        "filterList": [
          {
             "name":"customEnum"
          }
       ]
    }
    and select in on the list?

    Leave a comment:


  • How to add a custom filter with custom enum field values?

    Hi All,

    I want to have a custom filter search that displays record lists with last action like last Email and last Call. I would like to have the values Email and Call in a custom enum field.

    I tried creating the file custom/Espo/Custom/Selectmanagers/Contact.php

    <?php

    namespace Espo\Custom\SelectManagers;

    use Espo\Modules\Crm\SelectManagers\Contact as ContactCrm;

    class Contact extends ContactCrm
    {
    protected function filterCustomEnum(&$result)
    {
    $result['customJoin'] .= " LEFT JOIN note AS notes ON contact.id = notes.parent_id AND notes.deleted = 0 ";
    $this->addAndWhere(array(
    'notes.type' => 'EmailSent'
    ), $result);
    }

    }

    I get still get the whole collection. Im new to EspoCRM and still having hard time extending customs.

    Anyone can enlighten me on this?

    Thanks.
    Last edited by rgcadavos; 03-14-2017, 09:40 AM.
Working...