Hi, there,
I created a Logic Hook where to create a new empty Meeting. When saving the Call an error is generated.
I bring back the code of the hook:
class AfterSaveCallLogicHook
{
function openMeeting($bean, $event, $arguments)
{
if($bean->status=='Meeting'){
//ottengo l'id della lead associata alla chiamata
/*$rel="leads";
$bean->load_relationship($rel);
$lead_assoc_id=$bean->$rel->get()[0];
*/
// creo uno nuovo meeting
$meetingBean=BeanFactory::getBean('Meetings');
$meetingBean->name="Nuovo appuntamento3";
$meetingBean->description="Nuovo appuntamento scaturito da chiamata";
$meetingBean->save();
echo "<pre>";
var_dump($meetingBean);
echo "</pre>";
}
}
}
I tried the same code in an Entrypoint and it works.
I report the entry point code:
$meetingBean=BeanFactory::getBean('Meetings');
$meetingBean->name="Nuovo appuntamento2";
$meetingBean->description="Nuovo appuntamento scaturito da chiamata";
$meetingBean->save();
I report the error of suitecrm.log :
Mon Aug 26 17:49:13 2019 [20300][1][FATAL] SugarPHPMailer encountered an error: Invalid address: (to):