#230 - can't load relationships with account module
i'm using "646 Basic SecuritySuite 252.zip" version because i have 6.4.3 sugarcrm version . i have a relationship between account and securitygroups.
i'm trying to get the related records but it fails. this line returns false: $bean->load_relationship('securitygroups') this line causes sugar to fail with a blank screen: $relatedBeans = $bean->securitygroups->getBeans();
is it a bug that was in the previous version and fixed?
if not, how can i get the related records of this accont (this code is inside a logic hook)
11 years ago
This won't fix it, but use 643_Basic_SecuritySuite_252.zip for 6.4.3 and not the "646_*" file.
You won't be able to pull the related beans this way anymore for technical reasons related to how the module works and to support mass distribution (but mostly because SugarCRM changed the way relationships worked in 6.3 and left behind good many-to-many implementations).
You'll probably need to just create a SQL query to pull the relevant groups. There are some examples in modules/SecurityGroups/SecurityGroup.php that may point you in the right direction.