<div dir="ltr"><span style="font-family:arial,sans-serif;font-size:13.333333969116211px">vtiger_crmentityrel will be the relation tracking table.</span><div><br></div><div>Enforcing all modules to follow single guidelines is a way to go in future.<div>

Some legacy modules need more alignment to the same with migration.</div><div><br></div><div>Hope to get the backlog cleared soon. so that we jump over them and clean up.</div></div></div><div class="gmail_extra"><br clear="all">

<div><span style="border-collapse:collapse;font-family:arial,sans-serif;font-size:13px"><b>Connect with us on: </b><a href="http://twitter.com/vtigercrm" style="color:rgb(0,0,204)" target="_blank">Twitter</a> <b>I</b> <a href="http://www.facebook.com/pages/vtiger/226866697333578?sk=wall" style="color:rgb(0,0,204)" target="_blank">Facebook</a> <b>I</b> <a href="https://blogs.vtiger.com/" style="color:rgb(0,0,204)" target="_blank">Blog</a><b> I</b> <a href="http://wiki.vtiger.com/index.php/Main_Page" style="color:rgb(0,0,204)" target="_blank">Wiki</a> <b>I </b><a href="https://discussions.vtiger.com" style="color:rgb(0,0,204)" target="_blank">Forums </a><b>I</b> <a href="https://www.vtiger.com/" style="color:rgb(0,0,204)" target="_blank">Website</a></span></div>


<br><br><div class="gmail_quote">On Mon, Aug 25, 2014 at 3:30 PM, Holbok István <span dir="ltr"><<a href="mailto:holbok@gmail.com" target="_blank">holbok@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">


  

    
  
  <div text="#000000" bgcolor="#FFFFFF">
    <div>Hi Rishab,<br>
      <br>
      Thank you for the letter below.<br>
      I did some more experiments and I have found that only a few
      module uses the vtiger_crmentityrel table.<br>
      <br>
      The Contacts -> Accounts relation did not use.<br>
      The Contacts -> Products relation also did not use. This
      relation is tracked through the crmid of crmentity and through the
      table record of vtiger_seproductsrel<br>
      <br>
      The Contacts -> Assets relation did create a <b>vtiger_crmentityrel</b>
      record, but in the Contacts -> Assets relation automatically
      was created a new <b>Accounts -> Assets</b> relation also
      (independent that the Contacts -> Accounts related or not)<br>
      and this Accounts -> Assets relation is not recorded to the
      vtiger_crmentityrel table.<br>
      <br>
      My question is: what will be the future development trend? e.g.
      what is your suggestion?<br>
      Track the CustomModule other modules relation through relating
      entity_id field to crmid of the other record (similar to the
      Contacts and Accounts relation tracking) or<br>
      track the the CustomModule other modules relation through the
      API-s described below?<br>
      <br>
      The second solution is more complicated, but find a related record
      is easy with a simple query.<br>
      <br>
      As I see in this moment there are 3 - 4 or more different
      approaches in vtiger CRM to track relations of related modules
      records.<br>
      <br>
      Kindest regards:<br>
      István<div class=""><br>
      <br>
      <div>üdvözlettel:<br>
        <br>
        <b>Holbok István</b><br>
        <br>
        +3670-342-0900<br>
        <b>e-mail:</b> <a href="mailto:holbok@gmail.com" target="_blank">holbok@gmail.com</a><br>
        <b>SkyPe:</b> holboki<br>
        <br>
      </div></div>
      2014.08.20. 15:05 keltezéssel, Rishab K írta:<br>
    </div>
    <blockquote type="cite">
      <div dir="ltr">I reviewed this in the latest developer branch
        checkout 
        <div><br>
        </div>
        <div>Strange that nothing is getting added to <b>vtiger_crmentityrel.</b>It
          is working good in my case.</div>
        <div>Debugging in these areas might help you to get the exact
          issue.</div>
        <div><br>
        </div>
        <div>In <b>saveRecord</b> api of <b>SaveAjax.php </b>which is
          called when anyone tries to add a related module Record to to
          Existing Record.</div>
        <div><br>
        </div>
        <div>1.We check for the relation operation .</div>
        <div>2.call <b>addRelation</b> API by creating <b>RelationModel</b> with <b>ParentRecordsModuleModel</b> and
          the record we are trying to <b>RelateTo</b>.</div>
        <div>3.<b>addRelation API</b> of Relation Model makes a call<b> relateEntities </b>API
          of <b>utils.php</b> which calls save_related_module API of <b>CRMEntity</b>,once
          this is done and the records are linked.</div>
        <div><br>
        </div>
        <div>In case on Contacts and Accounts relation we track it in <b>vtiger_contactdetails</b> table
          by relating <b>accountid</b> field to <b>crmid</b> of
          Organization record.</div>
        <div><br>
        </div>
        <div>Regards,</div>
        <div>Rishab</div>
        <div><br>
        </div>
      </div>
    </blockquote>
    <br>
    <br>
  </div>

<br>_______________________________________________<br>
<a href="http://www.vtiger.com/" target="_blank">http://www.vtiger.com/</a><br></blockquote></div><br></div>