findRelated not working as expected

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • alexmiller
    Member
    • Jun 2018
    • 32

    findRelated not working as expected

    I'm hoping to get the findRelated function working
    there is a one to many relationship between Claims and Adjuster
    my code is as follows
    Code:
    $job = $entity->get('claimsId');
    $entityManager = $this->getEntityManager();
    $claim = $entityManager->getRepository('Claims')->get($jobs);
    $adjusterList = $entityManager->getRepository('Claims')->findRelated($claim, 'adjuster');
    this does not find any related Adjuster(s)

    what do i need to do to get the related entities from another entity??
  • tanya
    Senior Member
    • Jun 2014
    • 4308

    #2
    Is link name 'adjuster'?
    could you share custom/Espo/Custom/Repositories/metadata/entityDefs/Claims.json?

    Comment

    • alexmiller
      Member
      • Jun 2018
      • 32

      #3
      i think its adjuster but i tried that and it doesnt work either...
      Attached Files

      Comment

      • yuri
        Member
        • Mar 2014
        • 8474

        #4

        adjusters !
        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

        • alexmiller
          Member
          • Jun 2018
          • 32

          #5
          Yuri i tried this it doesnt not bring it up

          Comment

          • alexmiller
            Member
            • Jun 2018
            • 32

            #6
            hey real quick while i have your attention is it possible to change the order of the panels on the entities to move stream below all the other panels?

            Comment

            • tanya
              Senior Member
              • Jun 2014
              • 4308

              #7
              You can change the order in Layout Manager, but Stream panel always will be first
              What is Layout Manager? How can I configure it? A lot of questions and no answers? Watch the video tutorial below and get acquainted with EspoCRM’s Layout Manager.


              remove extra s
              $job = $entity->get('claimsId'); /// $claim = $entityManager->getRepository('Claims')->get($jobs);

              Comment

              • alexmiller
                Member
                • Jun 2018
                • 32

                #8
                is it possible to make stream always be last with some change?

                Comment

                • tanya
                  Senior Member
                  • Jun 2014
                  • 4308

                  #9
                  if with hard code
                  set here 20 for example https://github.com/espocrm/espocrm/b...bottom.js#L161 and remove 'sticked'
                  in upgrade safe way - you need to override recordViews detail and set own bottomView for each needed entity

                  Comment

                  • alexmiller
                    Member
                    • Jun 2018
                    • 32

                    #10
                    so i need to create a detail-bottom.js in each entity folder located in client/custom/src/view/ENTITY/detail-bottom.js?

                    Comment

                    • tanya
                      Senior Member
                      • Jun 2014
                      • 4308

                      #11
                      no
                      you need to define in ClientDefs of each module "recordViews":"detail" view.
                      after you create these views in client/custom/src/view/{your-view-name}.js
                      in each of these file you need to override own bottomView, like https://github.com/espocrm/espocrm/b.../detail.js#L96
                      also you need to create this bottom view

                      Comment

                      • alexmiller
                        Member
                        • Jun 2018
                        • 32

                        #12
                        what do i need to define in order to make them appear how i want? I'm not sure i follow you as i tried to use the unsafe for upgrade and it didnt seem to have any effect on the stream what-so-ever?!?!

                        Comment

                        • tanya
                          Senior Member
                          • Jun 2014
                          • 4308

                          #13
                          I think better to do it in not upgrade safe way. I think it will be implemented later

                          this.panelList.push({
                          "name":"stream",
                          "label":"Stream",
                          "view":"views/stream/panel",
                          "hidden": !streamAllowed,
                          "order": 22
                          });
                          Attached Files
                          Last edited by tanya; 08-13-2018, 08:05 PM. Reason: attachment

                          Comment

                          • alexmiller
                            Member
                            • Jun 2018
                            • 32

                            #14
                            that doesn't seem to work for me.

                            Comment

                            • tanya
                              Senior Member
                              • Jun 2014
                              • 4308

                              #15
                              what is your current version of EspoCRM?

                              Comment


                              • dreginald
                                dreginald commented
                                Editing a comment
                                My version - 5.7.6
                            Working...