1

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,

2

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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