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

Prasad prasad at vtiger.com
Mon Aug 25 10:13:37 GMT 2014


vtiger_crmentityrel will be the relation tracking table.

Enforcing all modules to follow single guidelines is a way to go in future.
Some legacy modules need more alignment to the same with migration.

Hope to get the backlog cleared soon. so that we jump over them and clean
up.

*Connect with us on: *Twitter <http://twitter.com/vtigercrm> *I* Facebook
<http://www.facebook.com/pages/vtiger/226866697333578?sk=wall> *I* Blog
<https://blogs.vtiger.com/>* I* Wiki
<http://wiki.vtiger.com/index.php/Main_Page> *I *Forums
<https://discussions.vtiger.com>*I* Website <https://www.vtiger.com/>


On Mon, Aug 25, 2014 at 3:30 PM, Holbok István <holbok at gmail.com> wrote:

>  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
>
>
>
>
> _______________________________________________
> http://www.vtiger.com/
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.vtigercrm.com/pipermail/vtigercrm-developers/attachments/20140825/d78e9b3d/attachment.html>


More information about the vtigercrm-developers mailing list