Changing Email View Window Layout

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • rodrigocoelho
    Active Community Member
    • Jun 2016
    • 296

    #1

    Changing Email View Window Layout

    Hi,

    Is it possible to change the email reader layout, like we can do with opportunities, etc?

    I already patched the JSON making email reader EDITABLE, and created a new field and changed the layout for the email reader window.

    But the layout didn't change as expected. The only way I found to change the field I've created was using Mass editing.

    Any tips on this?

    Thanks

    tanya
  • tanya
    Senior Member
    • Jun 2014
    • 4308

    #2
    Hi,
    hello! I need to change the compose email modal, just now I need add another select field and record this value in the database (mail table), what is the

    Try to Clear Cache

    Comment

    • rodrigocoelho
      Active Community Member
      • Jun 2016
      • 296

      #3
      Originally posted by tanya
      Hi,
      hello! I need to change the compose email modal, just now I need add another select field and record this value in the database (mail table), what is the

      Try to Clear Cache
      Hi Tanya, thanks for it.

      I've done all steps. It is working as expected on the email window, but the email list is not fetching the info of the new field. (in that case is the ANALISADO field on the end of rows), it is always like unmarked. It only updates its information if you click on the email (entering on it), and going back.

      Do you know why?

      Comment

      • tanya
        Senior Member
        • Jun 2014
        • 4308

        #4
        some fields has to be additional loaded for list in loadAdditionalFieldsForList service method
        Most entitys have a relation with teams, but in the layout of the entitys the team field is not there. Is there any config to change that? Thanks in advance

        Comment

        • rodrigocoelho
          Active Community Member
          • Jun 2016
          • 296

          #5
          Originally posted by tanya
          some fields has to be additional loaded for list in loadAdditionalFieldsForList service method
          https://forum.espocrm.com/forum/deve...-entity-layout
          I did this:

          Code:
          public function loadAdditionalFieldsForList(Entity $entity)
              {
                  parent::loadAdditionalFieldsForList($entity);
                  $entity->get('analisado');
                  $userEmailAdddressIdList = [];
                  foreach ($this->getUser()->get('emailAddresses') as $ea) {
                      $userEmailAdddressIdList[] = $ea->id;
                  }
          
                  $status = $entity->get('status');
          $entity->get('analisado'); was added, but it is giving "Erro 500: Class '\Espo\Custom\Services\Email' does not exist."

          Help please..

          Comment

          • yuri
            EspoCRM product developer
            • Mar 2014
            • 9540

            #6
            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

            • rodrigocoelho
              Active Community Member
              • Jun 2016
              • 296

              #7
              Hi Yuri, much easier. Thanks.

              I'm trying to create a CUSTOM service file for email, on the following folder:

              espocrm/custom/Espo/Custom/Services/

              But espo is returning "Erro 500: Class '\Espo\Custom\Services\Email' does not exist."
              How to deal with it? Not possible to create a custom service for it?

              Thanks.

              Comment

              • tanya
                Senior Member
                • Jun 2014
                • 4308

                #8
                Check the namespace in your custom service file

                Comment

                • rodrigocoelho
                  Active Community Member
                  • Jun 2016
                  • 296

                  #9
                  Hi Tanya. Even without editing the file, preserving the original one, it gives that error.

                  ​​​​​​I'm lost

                  Comment

                  • tanya
                    Senior Member
                    • Jun 2014
                    • 4308

                    #10
                    write the file path, namespace, and class declaration, please

                    Comment

                    • rodrigocoelho
                      Active Community Member
                      • Jun 2016
                      • 296

                      #11
                      Originally posted by tanya
                      write the file path, namespace, and class declaration, please
                      Hi Tanya, the file path is

                      /espocrm/custom/Espo/Custom/Services/Email.php

                      The original one is in /espocrm/application/Espo/Services/Email.php

                      The nameclass, etc. are the same. I only copied the original one on the custom folder.

                      Comment

                      • tanya
                        Senior Member
                        • Jun 2014
                        • 4308

                        #12
                        is it

                        <?php

                        namespace Espo\Custom\Services;
                        class Email extends \Espo\Services\Email
                        { ...

                        ?

                        Comment


                        • rodrigocoelho
                          rodrigocoelho commented
                          Editing a comment
                          Thanks Tanya, changing that works now.

                          A question: When having a custom PHP, like that, do I need to reproduce all other functions, etc. or, since it is extending the standard Email service, I would need to declare only new or changed functions?

                        • tanya
                          tanya commented
                          Editing a comment
                          needs to declare only new or changed functions
                      Working...