Hi, Manish
The Total Actual Effort" fields of Project is a calculated field based on its ProjectTasks, then it can't be defined only into vardefs field. You must:
Option 1: Create a sql joinning Contacts, Project and ProjectTasks to calculate the total effort of Project
Option 2: Modify the retrieve function into Contact.php to fill into a field the value of total effort and the custom field from project
If you don't worry about modifying the Contact.php bean then:
PHP Code:
require_once('modules/Project/Project.php');
$project = new Project();
$this->load_relationship('project');
$project_ids = $this->project->get();
foreach($project_ids as $project_id) {
$project->retrieve($project_id);
$this->total_actual_effort+= $project->total_actual_effort;
}
Doing a sql query could be faster to retrieve informations.
Cheers.
André Lopes
Lâmpada Global Services
Av. Angelica, 1814 cj. 1502
São Paulo, SP 01228-200
tel1. 55 11 3668-6776
tel2. 55 11 3822-2581
cel. 55 11 7636-5859
messenger: andopes@yahoo.com.br
skype: andopes
e-mail: andre@lampadacrm.com.br
Bookmarks