[Vtigercrm-developers] vtiger 7.0 cannot create task with status
IT-Solutions4You
info at its4you.sk
Wed Feb 6 15:23:51 GMT 2019
Maybe this is wrong ?
$activity = Vtiger_Record_Model::getCleanInstance("Events");
Calendar module is joined from 2 modules Events and Tasks.
Try to use Tasks not Events in getCleanInstance function
Matus
Dňa 16. 1. 2019 o 16:30 lucia digirolamo napísal(a):
> Hi,
>
> I'm trying to create a new task via workflow. The task is created but
> the status is empty. The code I'm using is the following:
>
> $activity = Vtiger_Record_Model::getCleanInstance("Events");
> $activity->set('mode', 'create');
> $activity->set('activitytype', 'Task');
> $activity->set('date_start', "2019-01-01");
> $activity->set('time_start', "09:00:00");
> $activity->set('due_date', "2019-01-31");
> $activity->set('taskstatus', 'Planned'); //$activity->set('status',
> 'Planned');
> $activity->set('visibility', 'Private');
> $activity->set('subject', "test");
> //$activity->set('description', '');
> //$activity->set('parent_id', $record['id']);
> $activity->set('assigned_user_id', 1);
> $activity->save();
>
> With both status and taskstatus the task gets created with the status
> field empty.
>
> NOTE: the same doesn't happen when creating an event.
>
> Any idea on how to solve it?
>
> Thanks
>
> _______________________________________________
> http://www.vtiger.com/
More information about the vtigercrm-developers
mailing list