Can I configure a workflow like "Schedule daily task to create on by its own" for my backups? Please share any doc's/video. Thanks for your help.
Schedule daily task to create on by its own
Collapse
X
-
Yes, you can. You just have to setup a job:
EspoCRM – Open Source CRM Application. Contribute to espocrm/espocrm development by creating an account on GitHub.
And also you can plan specific job in hook for example:
https://dubas.pro/c/?ea76adbef1ae1b7...inRD7abPnnhhE9 -
Hi chandra
Just an addition when you create you custom job, you don't need a hook to schedule it, in fact the crm will pick it up and you can schedule it (through UI) by creating a new scheduled Job under Admin/Schedule Jobs/ (Create Schedule Job) button. after that you can select from the list your custom job and schedule it. see attached screenshot. I have just gone through this lately and it works fine.Rabii
Web DevComment
-
Hi chandra
Please see below a code, i have created a new folder under custom\Espo\Custom\Jobs the folder name is jobs and i have placed all my current jobs there, see below a custom php job for my application that increments a field by one (which i have scheduled to be run each day at 1:10 am), file name UpdateClaimDwellTime.php :
Code:<?php namespace Espo\Custom\Jobs; use Espo\Core\ORM\EntityManager; use Espo\Core\Job\JobDataLess; class UpdateClaimDwellTime implements JobDataLess { protected $entityManager; public function __construct(EntityManager $entityManager) { $this->entityManager = $entityManager; } public function run(): void { $list = $this->entityManager ->getRepository('Claim') ->where([ 'stage!=' => ['Invoice Settled', 'Failed Processing'] ]) ->find(); foreach ($list as $e) { $dwellTime = $e->get('dwellTime'); $e->set('dwellTime', $dwellTime + 1); $this->entityManager->saveEntity($e); } } }
CheersRabii
Web DevComment
-
Hi chandra
Once you created the custom job, when you go to administration -> Scheduled Jobs (then on top right of the page click on create scheduled job) and you will see a page where you can select your job from list (you will find your custom job in the list) choose your custom job and give it a cron time execution. see attached screenshot.Rabii
Web DevComment
-
Comment
Comment