php - Sugar CRM getting relation of a bean with a one to many association -
this code:
<?php if(!defined('sugarentry') || !sugarentry) die('not valid entry point'); switch($_server['request_method']){ case 'get': $req = &$_get; break; case 'post': $req = &$_post; break; default: } echo ' 0 '; $focus = new m_formprocessor(); $focus->retrieve_by_string_fields(array('name' => $req['formprocessor'] )); echo ' 1 '; echo $focus->id; echo ' 2 '; $focus->load_relationship('m_modules'); echo ' 2.1.2 '; $list = array(); foreach ($focus->m_modules->getbeans() $m_module) { echo ' 2.2 '; echo $m_module->target; } echo ' 3 '; echo $focus->module->target; echo $focus->modules->target; echo $focus->m_modules->target; echo ' 4 '; ?> i following blog on page: http://developer.sugarcrm.com/2012/03/23/howto-using-the-bean-instead-of-sql-all-the-time/
but there seems error in foreach, advice help.
Comments
Post a Comment