Hi,
Here is the logic hook I have created after_save in custom/modules/Calls
PHP Code:
<?php
$hook_version = 1;
$hook_array = Array();
$hook_array['before_save'] = Array();
$hook_array['before_save'][] = Array(
0,
'UpdateSalesStage',
'custom/modules/Calls/UpdateSalesStage.php',
'UpdateSalesStage',
'UpdateSalesStage'
);
$hook_array['after_save'] = Array();
$hook_array['after_save'][] = Array(
0,
'RedirectBack',
'custom/modules/Calls/RedirectBack.php',
'RedirectBack',
'RedirectBack'
);
?>
This is the function created in custom/modules/Calls/RedirectBack.php
PHP Code:
<?php
if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
require_once('data/SugarBean.php');
class RedirectBack {
function RedirectBack(&$bean, $event, $arguments)
{
require_once('modules/Opportunities/Opportunity.php');
$bean->parent_id;
header("Location: index.php?action=DetailView&module=Opportunity&record=".$bean->parentid);
}
}
?>
After doing this my normal save button in Call EditView has a drop down which gets updated with opportunity is not working.
Please help me to solve this problem..
Bookmarks