Try our conversational search powered by Generative AI!

How to Capture Custom Scheduled Job is Turned on or Turned off in Episerver CMS

Vote:
 

Hi Guys,

We have a Custom Scheduled Job in Episerver 7.5 CMS under Scheduled Jobs, When the job is on, it runs the functionality what we require and job is off it doesnt process any thing. 

Now the Requirement is, when the custom job is off in CMS. Can we capture the scheduled job is off or on from CMS Tables anywhere. if so, how do we call CMS tables in c#.

#155410
Sep 16, 2016 8:41
Vote:
 

You can use the ScheduledJobRepository to get some information about the jobs. 

using EPiServer.DataAbstraction;
....
var jobRepository = ServiceLocator.Current.GetInstance<ScheduledJobRepository>();
var isEnabled = jobRepository.List()
                .First(job => job.Name.Contains("Notification"))
                .IsEnabled;

Above I list all jobs and grabs the first that contains the name Notification. You should be able to find yours there as well and check status. 

Hope that helps!

#155417
Edited, Sep 16, 2016 10:55
Vote:
 

Hi Arjun

There is a plug in that enables you to see the status of scheduled jobs: 

http://blog.tech-fellow.net/2013/10/17/overview-your-episerver-scheduled-jobs-interactively/

David

#155430
Sep 16, 2016 15:57
Vote:
 

+1 for David, if you are looking for table on db. Look in db with name like tblSchedule (although it is not recommended ) :)

#155442
Sep 16, 2016 21:36
This topic was created over six months ago and has been resolved. If you have a similar question, please create a new topic and refer to this one.
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.