[Vtigercrm-developers] Right way to test for relationship?

Alan Lord alanslists at gmail.com
Wed May 25 12:15:11 GMT 2016


I need to write a custom Event Handler for the HelpDesk module to check 
to see if a newly created ticket is related to a Project or not.

I can do this using database queries but I wonder if there is a "better" 
way using an already available method somewhere? I still find the design 
of the Relation models in v6 rather confusing.

For example - if I try to use the getRelatedModuleRecordIds() method in 
Vtiger_Module_Model this only works some of the time. I have found that 
the parentModule must have the relationships defined in its class file 
in the related_module_table_index array() for this to work - so it would 
seem that what is defined in vtiger_relatedlists is not always used..

Suggestions gratefully received.

Al



More information about the vtigercrm-developers mailing list