[Vtigercrm-developers] A question on vtiger_crmentityrel table in vtiger 6.1 beta

Holbok István holbok at gmail.com
Mon Aug 25 10:00:26 GMT 2014


Hi Rishab,

Thank you for the letter below.
I did some more experiments and I have found that only a few module uses 
the vtiger_crmentityrel table.

The Contacts -> Accounts relation did not use.
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

The Contacts -> Assets relation did create a *vtiger_crmentityrel* 
record, but in the Contacts -> Assets relation automatically was created 
a new *Accounts -> Assets* relation also (independent that the Contacts 
-> Accounts related or not)
and this Accounts -> Assets relation is not recorded to the 
vtiger_crmentityrel table.

My question is: what will be the future development trend? e.g. what is 
your suggestion?
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
track the the CustomModule other modules relation through the API-s 
described below?

The second solution is more complicated, but find a related record is 
easy with a simple query.

As I see in this moment there are 3 - 4 or more different approaches in 
vtiger CRM to track relations of related modules records.

Kindest regards:
István

üdvözlettel:

*Holbok István*

+3670-342-0900
*e-mail:* holbok at gmail.com
*SkyPe:* holboki

2014.08.20. 15:05 keltezéssel, Rishab K írta:
> I reviewed this in the latest developer branch checkout
>
> Strange that nothing is getting added to *vtiger_crmentityrel.*It is 
> working good in my case.
> Debugging in these areas might help you to get the exact issue.
>
> In *saveRecord* api of *SaveAjax.php *which is called when anyone 
> tries to add a related module Record to to Existing Record.
>
> 1.We check for the relation operation .
> 2.call *addRelation* API by creating *RelationModel* with 
> *ParentRecordsModuleModel* and the record we are trying to *RelateTo*.
> 3.*addRelation API* of Relation Model makes a call* relateEntities 
> *API of *utils.php* which calls save_related_module API of 
> *CRMEntity*,once this is done and the records are linked.
>
> In case on Contacts and Accounts relation we track it in 
> *vtiger_contactdetails* table by relating *accountid* field to 
> *crmid* of Organization record.
>
> Regards,
> Rishab
>


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.vtigercrm.com/pipermail/vtigercrm-developers/attachments/20140825/9d35674c/attachment.html>


More information about the vtigercrm-developers mailing list