<div dir="auto"><div dir="auto"></div>Alan First thank you for your answer<div dir="auto">But I think I didn't explain my self good, my problem is that I build a relation that similar to get_related_list using</div><div dir="auto">using $contactsModule->setRelatedList($VulnOrgModule, "VulnOrg", "","get_vulnorg_list");</div><div dir="auto"><br></div><div dir="auto">I can't use the basic get_related_list function because I saved the relation in different table because it doesn't want vtiger_crmentityrel table   to be too big</div><div dir="auto">and this relation has a lot of relations (similar to emails).</div><div dir="auto"><br></div><div dir="auto">Thank you again for your help</div><div dir="auto"><br></div><div dir="auto"><br></div><div dir="auto">n Thu, Jun 17, 2021, 13:22 Alan Lord (News) [via vtiger CRM] <<a href="mailto:no-reply@nabble.com" target="_blank" rel="noreferrer">no-reply@nabble.com</a>> wrote:<div dir="auto"><div class="gmail_quote" dir="auto"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

        I presume you have created a UIType 10 field in your custom module for a 
<br>Contact reference?
<br><br>e.g.:
<br>$module = Vtiger_Module::getInstance('vulOrg');
<br>$block = Vtiger_Block::getInstance('vulOrg Information', $module);
<br><br>$field = Vtiger_Field::getInstance('contact_id', $module);
<br>if ($field != false) {
<br>     $field->unsetRelatedModules(array('Contacts'));
<br>     $field->delete();
<br>}
<br>$field = new Vtiger_Field();
<br>$field->name = 'contact_id';
<br>$field->label = 'Contact';
<br>$field->column = $field->name;
<br>$field->columntype = 'INT(11)';
<br>$field->uitype = 10;
<br>$field->typeofdata = 'V~O';
<br>$field->summaryfield = 1;
<br>$field->masseditable = 0;
<br>$block->addField($field);
<br>$field->setRelatedModules(array('Contacts'));
<br><br>Then you _should_ be able to use the standard method to create the 
<br>relatedList in the Contact module. e.g.:
<br><br>$contacts = Vtiger_Module::getInstance('Contacts');
<br><br>$field = Vtiger_Field::getInstance('contact_id', $module);
<br>$contacts->unsetRelatedList($module, 'vulOrg', 'get_dependents_list');
<br>$contacts->setRelatedList($module, 'vulOrg', array('ADD'), 
<br>'get_dependents_list', $field->id);
<br><br>Something like that should do it.
<br><br>This was from memory so might need tweaking.
<br><br>Al
<br><br>On 17/06/2021 11:05, omri yona wrote:
<div><br>> Hello all,
<br>> 
<br>> I try to do something without changing the vtiger core. Maybe you have 
<br>> any idea.
<br>> My case:
<br>> I have a custom module (module name: vulOrg)  with  a relations to the 
<br>> contacts module so now in the Contacts module I have a new tab to my 
<br>> custom module.
<br>> To support this tab I need to change the contacts core file 
<br>> (modules/Contacts/Contacts.php)
<br>> 1. set new function get_vulorg (like get_emails...) to find my relations 
<br>> record (can't use the     basic get_related_list or get_dependents_list 
<br>> function)
<br>> 2. add flow in unlinkRelationship function
<br>> 
<br>> I manage to do what I want by changing the core file, but I don't like 
<br>> core changes.
<br>> 
<br>> I would love to get any ideas on how to do it without changing the core.
<br>> 
<br>> Thank you for your help,
<br>> Omri
<br>> 
<br>> 
<br>> 
<br>> _______________________________________________
<br>> <a href="http://www.vtiger.com/" rel="nofollow noreferrer noreferrer" link="external" target="_blank">http://www.vtiger.com/</a><br>> 
</div>_______________________________________________
<br><a href="http://www.vtiger.com/" rel="nofollow noreferrer noreferrer" link="external" target="_blank">http://www.vtiger.com/</a>

        
        
        
        <br>
        <br>
        <hr noshade size="1" color="#cccccc">
        <div style="color:#444;font:12px tahoma,geneva,helvetica,arial,sans-serif">
                <a href="http://vtiger-crm.2324883.n4.nabble.com/Vtigercrm-developers-extends-Contacts-class-new-relations-tp24300p24301.html" rel="noreferrer noreferrer" target="_blank">http://vtiger-crm.2324883.n4.nabble.com/Vtigercrm-developers-extends-Contacts-class-new-relations-tp24300p24301.html</a>
        </div>
        <div style="color:#666;font:11px tahoma,geneva,helvetica,arial,sans-serif;margin-top:.4em;line-height:1.5em">
                To unsubscribe from vtiger CRM, <a href="http://vtiger-crm.2324883.n4.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=2&code=b21yaS55b25hQGdtYWlsLmNvbXwyfC0xODc1MjMxMzE5" rel="noreferrer noreferrer" target="_blank">click here</a>.<br>
                <a href="http://vtiger-crm.2324883.n4.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml" rel="nofollow noreferrer noreferrer" style="font:9px serif" target="_blank">NAML</a>
        </div></blockquote></div></div></div></div>