hello everyone, I have the following problem, with beans, I can create records, but the relationship with l
the father record goes wrong …
//punto di ingresso per recupero dati..
//Create a new demo contact
$bean->load_relationship('Pri_PreventivoRighe');
$contactBean = BeanFactory::newBean('Pri_PreventivoRighe');
//Unlink the contact from the account - assumes $contactBean is a Contact SugarBean
//$contactBean->Pri_PreventivoRighe->delete($contactBean->id,'');
$contactBean->name = $value1['assicurazione'];
$contactBean->assicurazione_c = $value1['assicurazione'];
$contactBean->numerorate_c = $value1['numeroRate'];
$contactBean->taeg_c = $value1['TAEG'];
$contactBean->tan_c = $value1['TAN'];
$contactBean->teg_c = $value1['TEG'];
$contactBean->banca_c = $value1['banca'];
$contactBean->capitalelordo_c = $value1['capitaleLordo'];
$contactBean->commissionevenditore_c = $value1['commissioniVenditore'];
$contactBean->contobanca_c = $value1['contoBanca'];
$contactBean->importorata_c = $value1['importoRata'];
$contactBean->nettoricavo_c = $value1['nettoRicavo'];
$contactBean->premioimpiego_c = $value1['premioImpiego'];
$contactBean->premiovitae_c = $value1['premioVitae'];
$contactBean->speseistruttorie_c = $value1['speseIstruttorie'];
$contactBean->totaleassicurazione_c = $value1['totaleAssicurazione'];
$contactBean->messaggierrore_c = $value1['mesaggiErrore'];
$contactBean->save();
$bean->Pri_PreventivoRighe->add($contactBean);
i have this error??
[Wed Jan 09 12:31:47.859981 2019] [php7:warn] [pid 114192] [client 192.168.1.115:59741] PHP Warning: mysqli_real_escape_string() expects parameter 2 to be string, array given in /var/www/html/Kredias/include/database/MysqliManager.php on line 290, referer: http://192.168.1.102:8085/Kredias/index.php?action=ajaxui
[Wed Jan 09 12:31:48.048700 2019] [php7:notice] [pid 114192] [client 192.168.1.115:59741] PHP Notice: Undefined property: prv_GestionePreventivi::$Pri_PreventivoRighe in /var/www/html/Kredias/custom/modules/prv_GestionePreventivi/generaPreventivo.php on line 172, referer: http://192.168.1.102:8085/Kredias/index.php?action=ajaxui
[Wed Jan 09 12:31:48.049765 2019] [php7:error] [pid 114192] [client 192.168.1.115:59741] PHP Fatal error: Uncaught Error: Call to a member function add() on null in /var/www/html/Kredias/custom/modules/prv_GestionePreventivi/generaPreventivo.php:172\nStack trace:\n#0 /var/www/html/Kredias/include/MVC/View/SugarView.php(818): include_once()\n#1 /var/www/html/Kredias/include/MVC/View/views/view.classic.php(69): SugarView->includeClassicFile('custom/modules/...')\n#2 /var/www/html/Kredias/include/MVC/View/SugarView.php(211): ViewClassic->display()\n#3 /var/www/html/Kredias/include/MVC/Controller/SugarController.php(435): SugarView->process()\n#4 /var/www/html/Kredias/include/MVC/Controller/SugarController.php(375): SugarController->processView()\n#5 /var/www/html/Kredias/include/MVC/SugarApplication.php(113): SugarController->execute()\n#6 /var/www/html/Kredias/index.php(52): SugarApplication->execute()\n#7 {main}\n thrown in /var/www/html/Kredias/custom/modules/prv_GestionePreventivi/generaPreventivo.php on line 172, referer: http://192.168.1.102:8085/Kredias/index.php?action=ajaxui
[Wed Jan 09 12:31:51.323367 2019] [php7:notice] [pid 112930] [client 192.168.1.115:59742] PHP Notice: Undefined index: LBL_SUBTHEME_OPTIONS_Kredias in /var/www/html/Kredias/themes/SuiteP/themedef.php on line 79, referer: http://192.168.1.102:8085/Kredias/index.php?module=prv_GestionePreventivi&action=generaPreventivo&record=
someone could give me a hand, thanks in advance to everyone