Hi seanmh
Create the file custom/modules/Opportunities/controller.php with this content:
PHP Code:
<?PHP
require_once('include/MVC/Controller/SugarController.php');
class OpportunitiesController extends SugarController {
function action_editview() {
global $current_user;
if($this->bean->sales_stage == 'Closed Won' && $this->bean->ops_approval_date != '' && ! $current_user->check_role_membership('Sales')) {
$this->view = 'noaccess';
} else {
$this->view = 'edit';
}
$GLOBALS['view'] = $this->view;
}
}
?>
Probably you need to fix the name of the custom field
Cheers
Bookmarks