Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Timer job not listed in Timer Job Definitions Sharepoint 2007
- public override void FeatureActivated(SPFeatureReceiverProperties properties)
- {
- try
- {
- SPSecurity.RunWithElevatedPrivileges(delegate()
- {
- SPWeb parentWeb = properties.Feature.Parent as SPWeb;
- UpdateEmpReferralListTimer taskJob;
- SPMinuteSchedule schedule;
- foreach (SPJobDefinition job in parentWeb.Site.WebApplication.JobDefinitions)
- {
- if (job.Name == "xyz")
- job.Delete();
- }
- parentWeb = properties.Feature.Parent as SPWeb;
- taskJob = new UpdateEmpReferralListTimer("xyz", parentWeb.Site.WebApplication);
- schedule = new SPMinuteSchedule();
- schedule.BeginSecond = 0;
- schedule.EndSecond = 59;
- taskJob.Schedule = schedule;
- taskJob.Update();
- });
- }
- catch (Exception Ex)
- {
- string str = Ex.Message.ToString();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment