after creating a call and saving it; in the db, keep showing the default value, 300 = 5min. no matter what duration I change it to, the db still shows 300 in the duration column. from the user side, it shows what duration I set it to, but duration in the db always to default value. where can I rectify that?
Announcement
Collapse
No announcement yet.
call duration in db always set to default value?
Collapse
X
-
date end - date start does equal the duration, but in the db, it's still showing the default value in the duration column. the value of duration is not setting in the db. The, 1h 30m is not translating into the db. in the db, does show the correct date_end and date_start, but not the correct duration.
1 Photo
Comment
-
yuri I created a directory, application/espo/modules/crm/repositories/custom/call.php along with the code below:
PHP Code:
namespace Espo\Modules\Crm\Repositories; use Espo\ORM\Entity; class Call extends \Espo\Core\ORM\Repositories\RDB { protected function beforeSave(Entity $entity, array $options){ parent::beforeSave($entity,$options); if($entity->isFieldChanged('status')){ if($entity->get('status') == 'Held'){ $entity->set('dateCompleted',date('Y-m-d H:i:s')); } else{ $entity->set('dateCompleted',null); } } } }
Last edited by elbowprogrammer; 02-25-2016, 05:55 PM.
Comment
-
if I want to set datecompleted to a date when status has been changed to a specific status, which file would I implement that code? it would be similar to file, application/espo/modules/crm/repositories/task.php. there is a php call file in that same directory, but that class extends meeting.
Comment
Comment