Impossible to filter on Emails list view with Email from

Hi there,

We are facing a strange issue on the Emails list view. We can not filter this view based on the Email From address, did you face the same issue ? 

What could be a workaround as the customer is asking for this functionality.

I'm running on V12.0.3 ENT, same appears on 12.3.0 cloud.

I found this bug taht was closed, do you think it could be related ? 

https://portal.sugarondemand.com/index.php#supp_Bugs/b9d33f53-f795-2703-8422-52f0b8251db7

Best regards,

Enes

Parents
  • Hello Enes,

    if I'm understanding your question correctly, and if this is still relevant, you want to search by the actual e-mail address (i.e. someone@somewhere.com), and not a specific record. As far as I know, that's not possible in vanilla SugarCRM.

    There are two things you can do:

    1) Sync e-mail address to separate field, which is made searchable

    Create a new text field on Emails called e.g. "from_address_c" and an after-save logic hook that fetches the e-mail address via the 'to' link, and fills this field out. Then, make this field filterable. Be aware that the Emails module is not accessible via Studio, so you'll have to do all this manually.

    To create a custom field manually, take a look at e.g. support.sugarcrm.com/.../

    As for making a field filterable, I haven't done this for a while, but I think you need to create a Sidecar extension and add the field to $viewdefs['Emails']['base']['filter']['default']['fields']. Take a look at modules/Emails/clients/base/filters/default/default.php for inspiration. Alternatively, if it turns out this isn't the proper way to do it, add some field in some module to filterable fields in Studio, and then take a look at the extensions it creates - that should tell you what you need to do.

    Keep in mind that this approach is "sync intensive", which means that it's necessary to keep the value on the Email synchronized with the value accessed via the 'to' link. Since EmailAddresses is a separate module, I'm not sure what scenarios can happen, or if an after-save hook in Emails is enough.

    2) Use QuickQuery

    This, and much more, is supported out of the box. See https://docs.sugarquickqueryis.fun/useful-examples#_6xcm

    Disclaimer: I am the author of QuickQuery.

    Kind regards,

    Gabriel

Reply
  • Hello Enes,

    if I'm understanding your question correctly, and if this is still relevant, you want to search by the actual e-mail address (i.e. someone@somewhere.com), and not a specific record. As far as I know, that's not possible in vanilla SugarCRM.

    There are two things you can do:

    1) Sync e-mail address to separate field, which is made searchable

    Create a new text field on Emails called e.g. "from_address_c" and an after-save logic hook that fetches the e-mail address via the 'to' link, and fills this field out. Then, make this field filterable. Be aware that the Emails module is not accessible via Studio, so you'll have to do all this manually.

    To create a custom field manually, take a look at e.g. support.sugarcrm.com/.../

    As for making a field filterable, I haven't done this for a while, but I think you need to create a Sidecar extension and add the field to $viewdefs['Emails']['base']['filter']['default']['fields']. Take a look at modules/Emails/clients/base/filters/default/default.php for inspiration. Alternatively, if it turns out this isn't the proper way to do it, add some field in some module to filterable fields in Studio, and then take a look at the extensions it creates - that should tell you what you need to do.

    Keep in mind that this approach is "sync intensive", which means that it's necessary to keep the value on the Email synchronized with the value accessed via the 'to' link. Since EmailAddresses is a separate module, I'm not sure what scenarios can happen, or if an after-save hook in Emails is enough.

    2) Use QuickQuery

    This, and much more, is supported out of the box. See https://docs.sugarquickqueryis.fun/useful-examples#_6xcm

    Disclaimer: I am the author of QuickQuery.

    Kind regards,

    Gabriel

Children
No Data