Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

I need to disable a custom timer job when deactivating a feature and must run the timer job on activating the feature in SharePoint 2010. Can you please help me with the code or blogs or pointers.

Thanks,

share|improve this question

1 Answer 1

Within your feature receiver you can set the SPJobDefinition property isDisabled to get/set whether it is enabled.

To run the job during activation you call the RunNow method.

Here is a link to the SPJobDefinition Members - http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.administration.spjobdefinition_members.aspx

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.