Announcement

Collapse
No announcement yet.

Option to map emails with different Cases

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

  • Option to map emails with different Cases

    Hi i have a use case where i want to map an existing email to a case . There should be a option to choose which email i want to map on the selected case detail page.
    The email should be the same copy of previous mail having parent id of the selected case.

  • #2
    In this situation, it's easier to create a new Many-to-Many relationship between Case and Email and relay emails and cases to each other as you like, without paying attention to the Parent field of Email.

    This solution will partially solve your similar problem described here https://forum.espocrm.com/forum/gene...908#post109908.

    The main idea is to create your own Relationship to work with it in parallel, without interfering with the existing logic of interaction between Cases and Emails.
    More about relationships: https://docs.espocrm.com/administrat...#relationships.
    Last edited by victor; 10-08-2024, 10:47 AM.

    Comment


    • #3
      I think it's not that easy. At entity EMail you don't have a Layout Designer out of the box. But it is possible. You have to manually edit the relevant files for the layout, and proof if an update was installed in future.

      1)
      Version 8.2.0 and greater:
      /var/www/crm/application/Espo/Classes/RecordHooks/Email/BeforeUpdate.php

      Version lower than 8.2.0:
      /var/www/crm/application/Espo/Services/Email.php

      Insert the "new" fields, to allow them to be edited. Otherwise only Admins can change the link. For other users it would turn back to the old value.

      2)
      Edit the layout files manually (backup first). Examples:
      /var/www/crm/application/Espo/Resources/layouts/Email/detail.json detailRestricted.json detailSmall.json detailSmallRestricted.json
      and so on (ex. massUpdate.json)

      3) clear cache after editing

      If you make a mistake maybe the Espo-Site doesn't load again. So hold the "Clear Cache" at an other Tab, correct the files and clear cache again :-)


      Attached Files
      Last edited by macistda; 10-08-2024, 12:51 PM.

      Comment


      • #4
        what needs to add on these file
        detailRestricted.json detailSmall.json detailSmallRestricted.json
        and so on (ex. massUpdate.json) that you have mentioned in above 2 point​

        I added the parameters and also clear the cache, not showing the option
        Last edited by msonu719; 10-09-2024, 05:59 AM.

        Comment


        • #5
          This is no solution I can propose to solve what you need. Sadly with the Parent-Children system it is 1:1 relationship it is restrictive.

          The email layout can't be edit in GUI so I can't add in Relationship panel to do this.

          Anyway currently my solution is to auto link to some of my Case using Formula. What it does is search the email of the sender and my Reference number.

          Comment


          • #6
            Sorry, I was on a business trip. You have to add the fields / relations you defined (entities) to the JSON-Files, too. An example for "parentcase" is marked in the screenshot above. This is a two-column mask, but there is only one used in my case so the 2nd is set to false. Maybe you didn't use the syntax correctly?
            I added for this example [{"name":"parentcase"},false],​

            There are different JSON-Files, because there are different masks you can view / edit / write E-Mails at EspoCRM. Or even massUpdate.json if you want to be able to mass-update your related field(s). It works with Child-Parent and n:1, I didn't give it a try with n:n yet.

            Hope that helps!

            Comment

            Working...
            X