<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
</head>
<body smarttemplateinserted="true" text="#000000" bgcolor="#FFFFFF">
<div class="moz-cite-prefix">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<br>
<br>
<div class="moz-signature">üdvözlettel:<br>
<br>
<b>Holbok István</b><br>
<br>
+3670-342-0900<br>
<b>e-mail:</b> <a class="moz-txt-link-abbreviated" href="mailto:holbok@gmail.com">holbok@gmail.com</a><br>
<b>SkyPe:</b> holboki<br>
<br>
</div>
2014.08.20. 15:05 keltezéssel, Rishab K írta:<br>
</div>
<blockquote class=" cite"
id="mid_CAHU_C__t5fiG2UfXyOcb_wYUpyDbYxzPmSr_dMWswwhD5brkHg_mail_gmail_com"
cite="mid:CAHU-C+=t5fiG2UfXyOcb_wYUpyDbYxzPmSr_dMWswwhD5brkHg@mail.gmail.com"
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>
</body>
</html>