09-02-2023, 07:54 AM
Hello:
I am trying to register an email , using the code shows in https://blog.corebos.org/blog/sendemail. The email sends perfectly, but when I try to register it, returns
Fatal error: Uncaught WebServiceException: Database error while performing required operation in /home/coralloagency/www/pruebas/include/Webservices/VtigerEmailOperation.php:78 Stack trace: #0 /home/coralloagency/www/pruebas/modules/Emails/mail.php(795): VtigerEmailOperation->create('Emails', Array) #1 /home/coralloagency/www/pruebas/modules/Invoice/customInvoicePDF.php(239): createEmailRecord(Array) #2 {main} thrown in /home/coralloagency/www/pruebas/include/Webservices/VtigerEmailOperation.php on line 78
The problem is in the value that returns this function:
$accountid = vtws_getEntityId('Accounts').'x5'; // I change the account id for one in the database
If I comment the value parent_in the $email array, the email sends, but it don't register in the database
$email = array(
'saved_toid' => $to_email,
'parent_type' => 'Accounts',
'parent_id' => $accountid,
'from_email' => $from_email,
'subject' => $subject,
'description' => $content,
);
the value that vtws_getEntityId('Accounts') returns is 11 ( the value of accounts in vtiger_ws_entity), and 5 is a register user in the aplication ...
Any idea?
Thank you
I am trying to register an email , using the code shows in https://blog.corebos.org/blog/sendemail. The email sends perfectly, but when I try to register it, returns
Fatal error: Uncaught WebServiceException: Database error while performing required operation in /home/coralloagency/www/pruebas/include/Webservices/VtigerEmailOperation.php:78 Stack trace: #0 /home/coralloagency/www/pruebas/modules/Emails/mail.php(795): VtigerEmailOperation->create('Emails', Array) #1 /home/coralloagency/www/pruebas/modules/Invoice/customInvoicePDF.php(239): createEmailRecord(Array) #2 {main} thrown in /home/coralloagency/www/pruebas/include/Webservices/VtigerEmailOperation.php on line 78
The problem is in the value that returns this function:
$accountid = vtws_getEntityId('Accounts').'x5'; // I change the account id for one in the database
If I comment the value parent_in the $email array, the email sends, but it don't register in the database
$email = array(
'saved_toid' => $to_email,
'parent_type' => 'Accounts',
'parent_id' => $accountid,
'from_email' => $from_email,
'subject' => $subject,
'description' => $content,
);
the value that vtws_getEntityId('Accounts') returns is 11 ( the value of accounts in vtiger_ws_entity), and 5 is a register user in the aplication ...
Any idea?
Thank you