Announcement

Collapse
No announcement yet.

Lead/Contact view all email attachements sent and received

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Lead/Contact view all email attachements sent and received

    Hello,

    Is the are a possibility to show in the lead/contact panel all attachments send and received from that certain person?

    I saw there is an ”attachments” options but it is not related with the email records.

    Thank you!

  • #2
    Hi Cris.
    Here is how you can get a panel of the all Attachment that attached to Email where the Contact is Parent.
    1. Administration -> Entity Manager -> Attachment -> Relationship ->
    - add Many-to-One relation to Contact
    - add Many-to-One relation to Email
    2. Administration -> Entity Manager -> Attachment -> Formula:
    Code:
    ifThen(
        parentType == 'Email',
        emailId = parentId
    );
    
    ifThen(
        emailId && email.parentType == 'Contact',
        contactId = email.parentId
    );
    3. Administration -> Layout Manager -> Attachment -> list (small) -> add parent field to see what Email is a parent of this attachment
    4. Administration -> Layout Manager -> Contacts -> Bottom Panels -> add the Attachment panel
    5. Administration -> Attachments -> Select all Attachments -> Recalculate Formula
    6. Open the Contact and check whether Attachments are in the panel.

    Comment


    • Maximus
      Maximus commented
      Editing a comment
      UPD: BTW, to be able to customize Attachment you need to do this:
      1. Create the file /custom/Espo/Custom/Resources/metadata/scopes/Attachment.json and add this code to it:
      Code:
      {"layouts":true,"tab":true,"acl":true, "customizable":true}
      2. Administration -> Clear Cache
      3. Refresh a web page

      Parameters explenation:
      - "layouts":true - gives an access to the Administration -> Layout Manager -> Attachment scope;
      - "tab":true - gives an access to set Attachment tab;
      - "acl":true - gives an access to set a Role permission for Attachment;
      - "customizable":true - gives an ability to customize Attachment.

  • #3
    Oh this is beautiful, going to test it now. But I wonder if it will lag the server considering this task might be quite exhausting through formula method. Here is some addition notes based on my experience.

    The Attachment Entity option is hidden, you will need to open the URL manually by adding this code at end of your website URL:

    /#Admin/linkManager/scope=Attachment

    Same with Layout Manager, I manage to use this URL to get it to open:
    /#Admin/layouts/scope=Attachments&em=true
    OR you can also use:
    /#Admin/layouts/scope=Attachments&type=listSmall

    No problem with Step 1, 4, 5 and 6 at this stage. Step 5 probably will show up once I add in formula from Step 2 right?

    --- actually I'm struck, how can I open formula? It is a javascript command so URL trick doesn't work. Secondly there is no "field" to add in List(small), do we need to create a field first? What type of field?
    Maximus

    Last edited by espcrm; 06-26-2020, 06:13 AM.

    Comment


    • Maximus
      Maximus commented
      Editing a comment
      Hi,

      > Step 5 probably will show up once I add in formula from Step 2 right?

      You are right. This action appears after you set some Formula for an entity.

      > --- actually I'm struck, how can I open formula? It is a javascript command so URL trick doesn't work. Secondly there is no "field" to add in List(small), do we need to create a field first? What type of field?

      I updated my previous post. See here https://forum.espocrm.com/forum/gene...9882#post59882

  • #4
    Follow Maximus update guide and manage to get it working. I re-calculate all formula and it didn't seem to freeze the server, which is a good thing. One contact I check got 17,000+ attachment, all these "Image" in the email is linked to.

    Anyway here some tips if anyone plan to use it.
    1) I'm not sure if it me but the Attachment Bottom Panel is blank, you need to select "... > View List" to see them. I just check again, actually it that my formula didn't link them properly, I wonder if it due to this contact having multiple email.
    2) As with the above comments, all attachment will get link so your server might have issue in future or right away.
    3) I think a Clear Cache or a Rebuild also wipe out these Attachment linking so you might have to re-calculate formula again.

    I will see how it goes and report back.

    Question: does the "Parent" or "Related" in attachments list (Administration -> Attachments) get update after you recalculate Formula?

    ---

    Off-topic:
    Using the trick for Email.json did not work, I can see email and change the layout but it doesn't reflect the actual layout.
    {"layouts":true,"tab":true,"acl":true, "customizable":true}
    Last edited by espcrm; 06-29-2020, 01:44 AM.

    Comment


    • Maximus
      Maximus commented
      Editing a comment
      Hi,

      > Question: does the "Parent" or "Related" in attachments list (Administration -> Attachments) get update after you recalculate Formula?

      It shouldn't update Parent. The formula affects only those new Contact/Email relationships.

      > Using the trick for Email.json did not work, I can see email and change the layout but it doesn't reflect the actual layout.
      {"layouts":true,"tab":true,"acl":true, "customizable":true}

      Utilizing this way you can change a list view. There is no such an ability to change the detail view. It should be done via code changing. The only way I am aware of is customizing the email template file.
      Note. The proper way to make some changes is to redefine the code in the /client/custom directory.

    • espcrm
      espcrm commented
      Editing a comment
      I will see how it behave over time and report back. Thanks Maximus.
Working...
X