Did anyone try this?
I have a custom module I created a field next visit, I want to make an event after saving my record in my custom module based on next visit field date. here's the following code tried.
public function process(Vtiger_Request $request) {
try {
$CustomSaveEvents= $this->saveAppointmentRecord();
} catch (Exception $e) {
throw new Exception($e->getMessage());
}
}
public function saveAppointmentRecord() {
try {
$linkModule ="Events";
$recordModel1 = Vtiger_Record_Model::getCleanInstance($linkModule);
$recordModel1->set('subject', "Sample");
$recordModel1->set('mentorid',"6411");
$recordModel1->set('apprenticeid',"10849");
$recordModel1->set('due_date', '2022-10-24');
$recordModel1->set('time_end','2022-10-24');
$recordModel1->set('mode', 'create');
$recordModel1->save();
$this->savedRecordId = $recordModel1->getId();
return $recordModel1;
}catch (Exception $e) {
throw new Exception($e->getMessage());
}
}
But it didn't work. any can help me? Thank you in advance!
calendar will show new record