I'd like to make standard relationship between Account record and Contact record on the code level. I get through some code and find method Vtiger_Relation_Model::addRelation() that was used in standard Save action. The problem is that when i run this code:
/*
* $company is Account model
* $contact is Contact model
*/
$relation = Vtiger_Relation_Model::getInstance($company->getModule(), $contact->getModule());
if($relation){
$relation->addRelation($company->getId(), $contact->getId());
}
i can't find it in contact list of account. What is interesting is that "Updates" shows that indeed relationship was created.

I run out of ideas how to make this record show up in "Contacts list".
Can you provide some knowlage how to correctly make records relationship or point me to some examples?
Hi @gjanczak-pfrportal,
updates box shows relation because a record was added to vtiger_relatedlists table.
My question is: did you insert account crmid into vtiger_contactdetails.parentid field?
@davide-alghi It worked!
May I assume this is the case for all relationships?
you are creating a 1:M relation
this is valid only for this type of relation