Display related entities in One to Many relationship as a list field

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • rabii
    Active Community Member
    • Jun 2016
    • 1250

    Display related entities in One to Many relationship as a list field

    Does anyone know how to display related entities in a One To Many relationship as list field. I have account Has Many competitors (Account One to Many Competitor) and i would like to list all competitors that belong to an account in a list field within the account view. same as opportunity and opportunityItem list.

    Many thanks

    telecastg item emillod please help if you know how to achieve this.
    Rabii
    Web Dev
  • item
    Active Community Member
    • Mar 2017
    • 1476

    #2
    Hi,
    if you have Advanced Pack.. look ReportPanel in admin section.
    you can create report list or grid

    and then create report panel as side or bottom..

    not undertand all but perfect
    If you could give the project a star on GitHub. EspoCrm believe our work truly deserves more recognition. Thanks.​

    Comment

    • rabii
      Active Community Member
      • Jun 2016
      • 1250

      #3
      Thanks for your reply, i don’t want to use reports hence i need to apply custom row actions to the list. I am interested to add a field like itemList which display data in a list format in a parent view. As explained something like opprtunityItem on opportunity.
      Rabii
      Web Dev

      Comment

      • dimyy
        Active Community Member
        • Jun 2018
        • 569

        #4
        Try check "Link Multiple Field" and add field to detail view
        Attached Files

        Comment

        • rabii
          Active Community Member
          • Jun 2016
          • 1250

          #5
          that would only allow to add one field. my purpose if to show whole list of field of related entities.
          Rabii
          Web Dev

          Comment

          • lazovic
            Super Moderator
            • Jan 2022
            • 810

            #6
            Hi rabii,

            Through the UI, you can make two display options: as in the first picture, just a list of related Competitors under the red panel, or as in the second picture, on the Bottom Panel, where you can select the fields of your Competitors records you need to display. Please take a look:

            Click image for larger version  Name:	1.png Views:	0 Size:	14.0 KB ID:	81865Click image for larger version  Name:	2.png Views:	0 Size:	17.7 KB ID:	81866

            If these options do not suit you, try to make a small drawing of how it should look like, and then the EspoCRM community will be able to help you faster.

            Comment

            • rabii
              Active Community Member
              • Jun 2016
              • 1250

              #7
              I am aware of relationship panels but it is not what i am looking for, as mentioned before if you have sales pack you can see that opportunity has a list item field which list all opportunityItems and that is what exactly i want a field which list a list of field of related entity. see attached screenshot for your reference.
              Attached Files
              Rabii
              Web Dev

              Comment

            • rabii
              Active Community Member
              • Jun 2016
              • 1250

              #8
              i have the extension but i wanted to build this my way hence it has lore then just listing, some calculations will be done based on certain conditions. with the extension i can't extend such functionality.
              Rabii
              Web Dev

              Comment

              • shalmaxb
                Senior Member
                • Mar 2015
                • 1606

                #9
                rabii, hello. Did you ever solve that? I have a similar problem, where I need the links as a string (list).

                Comment

                • rabii
                  Active Community Member
                  • Jun 2016
                  • 1250

                  #10
                  Originally posted by shalmaxb
                  rabii, hello. Did you ever solve that? I have a similar problem, where I need the links as a string (list).
                  Yes managed to do it but was not perfect so still trying to improve it. there is a lot that goes into that.
                  Rabii
                  Web Dev

                  Comment


                  • shalmaxb
                    shalmaxb commented
                    Editing a comment
                    One thing, I do not understand: I can read the Ids from the multiple link and display in a textbox. But not the names (what would be, what I need).
                    Is there a way to get the names by having the Id?
                • rabii
                  Active Community Member
                  • Jun 2016
                  • 1250

                  #11
                  Originally posted by rabii

                  Yes managed to do it but was not perfect so still trying to improve it. there is a lot that goes into that.
                  can you share your code. you should be able to read names too.
                  Rabii
                  Web Dev

                  Comment

                  • shalmaxb
                    Senior Member
                    • Mar 2015
                    • 1606

                    #12
                    Here a screenshot of the situation:

                    Click image for larger version

Name:	link_to_text.jpg
Views:	457
Size:	51.6 KB
ID:	99140

                    Comment

                    • rabii
                      Active Community Member
                      • Jun 2016
                      • 1250

                      #13
                      I see the technikListenwerteNames will return null, here is a fix you can use the code below instead:

                      PHP Code:
                      if (technikListenwerteIds) {
                          
                          $names = list();
                          
                          $i = 0;
                          
                          while ($i < array\length(technikListenwerteIds)) {
                              
                              $o = record\fetch('TechnikListenwerte', array\at(technikListenwerteIds, $i));
                          
                              if ($o) {
                                  $name = object\get($o, 'name');
                              }
                              
                              $names = array\push($names, $name);
                              
                              $i = $i + 1;
                          }
                          
                          technik2 =  array\join($names, ',');
                      }

                      I hope this helps
                      Rabii
                      Web Dev

                      Comment


                      • shalmaxb
                        shalmaxb commented
                        Editing a comment
                        rabii, great (again and again). This code works. Thank you very much!

                      • rabii
                        rabii commented
                        Editing a comment
                        you are welcome
                    Working...