after_retrieve logic hook failed in quote and invoice module with error

hi,

have implement the ‘after_retrieve’ logic hook in quote / invoice module ,
when open detail view of any, got following popup error …

An Error has occurred:
There was an error processing your request, please try again at a later time.

sample code:

custom/modules/AOS_Quotes/logic_hooks.php

<?php

   $hook_version = 1;
   $hook_array = Array();
   $hook_array['after_retrieve'] = Array(); 
  $hook_array['after_retrieve'][] = Array(1, 'creditonhold3', 'custom/modules/AOS_Quotes/creditonhold3.php','creditonhold3', 'ShowLog');  

  $hook_array['after_save'] = Array();
  $hook_array['after_save'][] = Array(1,'Save checkbox value to Oppt Amt', 'custom/modules/AOS_Quotes/creditonhold3.php', 'creditonhold3', 'ShowLog');
   
   
   
?>

custom/modules/AOS_Quotes/creditonhold3.php

<?php 

if (!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');

#require_once('modules/Opportunities/Opportunities.php'); 

 
 

class creditonhold3

{ 

protected static $fetchedRow = array(); 

public function GetValue($Bean, $event, $arguments) 

{ 

$o=new Opportunity();
 
$o->retrieve($Bean->opportunity_id); //check but I believe that's the account id relate field in the case 

$a = new Account();

$a->retrieve($o->account_id_c)

$field_one_value = $a->credit_hold_c; 
$Bean->credit_hold_c = $field_one_value; 
} 

 
 

public function ShowLog($Bean, $event, $arguments){ 

 
$GLOBALS['log']->fatal("fareed::");  

 
 
 

} 

 
 

} 

?>

In your php.ini there is a definition of your PHP error log. Check it is enabled and what the file name is (frequently php_errors.log or errors.log).

In that log you should find a PHP Fatal error when that code runs, see what it is so you can fix your code.

1 Like

issue resolved , thanks support.