{"id":1774,"date":"2019-06-18T12:21:24","date_gmt":"2019-06-18T12:21:24","guid":{"rendered":"https:\/\/dev.outrightcrm.in\/dev\/store\/?p=1774"},"modified":"2022-02-01T10:32:41","modified_gmt":"2022-02-01T10:32:41","slug":"suitecrm-create-a-new-scheduled-job-by-code","status":"publish","type":"post","link":"https:\/\/dev.outrightcrm.in\/dev\/store\/blog\/suitecrm-create-a-new-scheduled-job-by-code\/","title":{"rendered":"SuiteCRM Create a New Scheduled Job by Code"},"content":{"rendered":"<p><\/p>\n\n\n<\/p>\n<p>Create a new file at<\/p>\n<p>\n\n\n<p><\/p>\n\n\n<\/p>\n<p><strong>customExtensionmodulesSchedulersExtScheduledTasks<\/strong><\/p>\n<p>\n\n\n<p><\/p>\n\n\n<\/p>\n<p>Let it call \u201c<strong>outright_do_repair.php<\/strong>\u201d<\/p>\n<p>\n\n\n<p><\/p>\n\n\n<\/p>\n<p>Content on this file<\/p>\n<p>\n\n\n<p><\/p>\n\n\n<\/p>\n<blockquote>\n<pre><p>   &lt;?php<\/p><p>   array_push($job_strings, \u2018outright_do_repair\u2019);<\/p>\n<\/blockquote>\u00a0<\/pre>\n<p>\n\n\n<p><\/p>\n\n\n<\/p>\n<p>Now go to<\/p>\n<p>\n\n\n<p><\/p>\n\n\n<\/p>\n<p><strong>customExtensionapplicationExtUtils.php<\/strong><\/p>\n<p>\n\n\n<p><\/p>\n\n\n<\/p>\n<p>Create a new file , let it call \u201c<strong>outright_cron_utils.php<\/strong>\u201d.<\/p>\n<p>\n\n\n<p><\/p>\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/dev.outrightcrm.in\/dev\/store\/dev\/store\/wp-content\/uploads\/2019\/06\/Scheduled-Job-by-code1.png\" alt=\"Scheduled Job by code\" \/><\/figure>\n\n\n<p><\/p>\n\n\n<\/p>\n<blockquote class=\"is-layout-flow wp-block-quote-is-layout-flow\">\n<pre><p>    &lt;?php<\/p>\n<p>    function outright_do_repair(){<\/p>\n<p>    require_once(\"modules\/Administration\/QuickRepairAndRebuild.php\");<\/p>\n<p>\u00a0\u00a0\u00a0 global $moduleList;<\/p>\n<p>\u00a0\u00a0\u00a0 $repair = new RepairAndClear();<\/p>\n<p>\u00a0\u00a0\u00a0 $repair-&gt;repairAndClearAll(array(\"clearAll\"),$moduleList, true,false);<\/p>\n<p>\u00a0\u00a0\u00a0 $exit_on_cleanup = true;<\/p>\n<p>\u00a0\u00a0\u00a0 sugar_cleanup(false);<\/p>\n<p>    }<\/p>\n<\/blockquote>\n<\/pre>\n<p>\n\n\n<p><\/p>\n\n\n<p>Now go to admin-&gt;Scheduler<\/p>\n\n\n<p><\/p>\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/dev.outrightcrm.in\/dev\/store\/dev\/store\/wp-content\/uploads\/2019\/06\/Schedulers-Job.png\" alt=\"\" \/><\/figure>\n\n\n<p><\/p>\n\n\n<p>Then create a new scheduler with created function and set the schedule time.<\/p>\n\n\n<p><\/p>","protected":false},"excerpt":{"rendered":"<p>Scheduler plays a crucial role in CRM. Automatic send emails, auto create backups and many more tasks. User will only set the time in SuiteCRM Scheduler and system will automatically perform the set of operations on the scheduled time How we create a new scheduler job in SuiteCRM? <\/p>\n","protected":false},"author":31,"featured_media":44942,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"site-sidebar-layout":"default","site-content-layout":"","ast-site-content-layout":"","site-content-style":"default","site-sidebar-style":"default","ast-global-header-display":"","ast-banner-title-visibility":"","ast-main-header-display":"","ast-hfb-above-header-display":"","ast-hfb-below-header-display":"","ast-hfb-mobile-header-display":"","site-post-title":"","ast-breadcrumbs-content":"","ast-featured-img":"","footer-sml-layout":"","theme-transparent-header-meta":"","adv-header-id-meta":"","stick-header-meta":"","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":"","astra-migrate-meta-layouts":"default","ast-page-background-enabled":"default","ast-page-background-meta":{"desktop":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"ast-content-background-meta":{"desktop":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"footnotes":""},"categories":[55],"tags":[],"class_list":["post-1774","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-suitecrm"],"acf":[],"_links":{"self":[{"href":"https:\/\/dev.outrightcrm.in\/dev\/store\/wp-json\/wp\/v2\/posts\/1774","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/dev.outrightcrm.in\/dev\/store\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/dev.outrightcrm.in\/dev\/store\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/dev.outrightcrm.in\/dev\/store\/wp-json\/wp\/v2\/users\/31"}],"replies":[{"embeddable":true,"href":"https:\/\/dev.outrightcrm.in\/dev\/store\/wp-json\/wp\/v2\/comments?post=1774"}],"version-history":[{"count":0,"href":"https:\/\/dev.outrightcrm.in\/dev\/store\/wp-json\/wp\/v2\/posts\/1774\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/dev.outrightcrm.in\/dev\/store\/wp-json\/wp\/v2\/media\/44942"}],"wp:attachment":[{"href":"https:\/\/dev.outrightcrm.in\/dev\/store\/wp-json\/wp\/v2\/media?parent=1774"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/dev.outrightcrm.in\/dev\/store\/wp-json\/wp\/v2\/categories?post=1774"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/dev.outrightcrm.in\/dev\/store\/wp-json\/wp\/v2\/tags?post=1774"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}