Hi gents
Iâd like to create a new note useing âBeanFactory::newBean(âNotesâ);â. So far it works perfect. Since it is a system generated note, Iâd like to save the System User (Administrator with ID 1) in the field âcreated_byâ and âmodified_user_idâ, but what ever I try, itâs always NULL in the DB.
Here the code sniped:
// get system user for creating notes
$systemUser = BeanFactory::getBean('Users', 1);
// create a note to the contact
$note = newNote('Contacts', $delegate_id);
$note->name = 'blabla';
$note->description = 'blabla';
$note->modified_user_id = $systemUser->id;
$note->created_by = $systemUser->id;
$note->contact_id = $delegate_id;
$note->save();
I also tried it directly with â$note->created_by = â1ââ. But no luck.
I am using SuiteCRM 8.7.1 in PROD and 8.8-beta in DEV with PHP 8.1.31.
Any ideas what I am doing wrong?
Thanks for your help.
Carsten