[Vtigercrm-developers] extends Contacts class - new relations

Alan Lord alanslists at gmail.com
Sat Jun 19 10:31:46 GMT 2021


What is "too big"? I have customers with millions of rows in the 
crmentityrel table and they do not have any performance issues.

Al


On 17/06/2021 19:56, omri yona wrote:
> Alan First thank you for your answer
> 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
> using $contactsModule->setRelatedList($VulnOrgModule, "VulnOrg", 
> "","get_vulnorg_list");
> 
> 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
> and this relation has a lot of relations (similar to emails).
> 
> Thank you again for your help
> 
> 
> n Thu, Jun 17, 2021, 13:22 Alan Lord (News) [via vtiger CRM] 
> <no-reply at nabble.com <mailto:no-reply at nabble.com>> wrote:
> 
>     I presume you have created a UIType 10 field in your custom module
>     for a
>     Contact reference?
> 
>     e.g.:
>     $module = Vtiger_Module::getInstance('vulOrg');
>     $block = Vtiger_Block::getInstance('vulOrg Information', $module);
> 
>     $field = Vtiger_Field::getInstance('contact_id', $module);
>     if ($field != false) {
>           $field->unsetRelatedModules(array('Contacts'));
>           $field->delete();
>     }
>     $field = new Vtiger_Field();
>     $field->name = 'contact_id';
>     $field->label = 'Contact';
>     $field->column = $field->name;
>     $field->columntype = 'INT(11)';
>     $field->uitype = 10;
>     $field->typeofdata = 'V~O';
>     $field->summaryfield = 1;
>     $field->masseditable = 0;
>     $block->addField($field);
>     $field->setRelatedModules(array('Contacts'));
> 
>     Then you _should_ be able to use the standard method to create the
>     relatedList in the Contact module. e.g.:
> 
>     $contacts = Vtiger_Module::getInstance('Contacts');
> 
>     $field = Vtiger_Field::getInstance('contact_id', $module);
>     $contacts->unsetRelatedList($module, 'vulOrg', 'get_dependents_list');
>     $contacts->setRelatedList($module, 'vulOrg', array('ADD'),
>     'get_dependents_list', $field->id);
> 
>     Something like that should do it.
> 
>     This was from memory so might need tweaking.
> 
>     Al
> 
>     On 17/06/2021 11:05, omri yona wrote:
> 
>      > Hello all,
>      >
>      > I try to do something without changing the vtiger core. Maybe you
>     have
>      > any idea.
>      > My case:
>      > I have a custom module (module name: vulOrg)  with  a relations
>     to the
>      > contacts module so now in the Contacts module I have a new tab to my
>      > custom module.
>      > To support this tab I need to change the contacts core file
>      > (modules/Contacts/Contacts.php)
>      > 1. set new function get_vulorg (like get_emails...) to find my
>     relations
>      > record (can't use the     basic get_related_list or
>     get_dependents_list
>      > function)
>      > 2. add flow in unlinkRelationship function
>      >
>      > I manage to do what I want by changing the core file, but I don't
>     like
>      > core changes.
>      >
>      > I would love to get any ideas on how to do it without changing
>     the core.
>      >
>      > Thank you for your help,
>      > Omri
>      >
>      >
>      >
>      > _______________________________________________
>      > http://www.vtiger.com/ <http://www.vtiger.com/>
>      >
>     _______________________________________________
>     http://www.vtiger.com/ <http://www.vtiger.com/>
> 
>     ------------------------------------------------------------------------
>     http://vtiger-crm.2324883.n4.nabble.com/Vtigercrm-developers-extends-Contacts-class-new-relations-tp24300p24301.html
>     <http://vtiger-crm.2324883.n4.nabble.com/Vtigercrm-developers-extends-Contacts-class-new-relations-tp24300p24301.html>
> 
>     To unsubscribe from vtiger CRM, click here
>     <http://vtiger-crm.2324883.n4.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=2&code=b21yaS55b25hQGdtYWlsLmNvbXwyfC0xODc1MjMxMzE5>.
>     NAML
>     <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>
> 
> 
> 
> _______________________________________________
> http://www.vtiger.com/
> 


More information about the vtigercrm-developers mailing list