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 have been tasked with writing a couple custom SPJobDefinitions and have 2 blocking questions regarding its implementation.

What constructor should I use?

I have noticed two that I can use. One using an SPWebApplication and one using an SPService. Im leaning towards SPService as SPWebApplication implies its fairly specific.

How do I tie it into central admin?

I know I am to use a feature, and have the workings of one, but am stuck on how to get either the service application or the web application required for the constructors.

Does anyone have any advice for the novice timer job developer?

Thanks in advance.

share|improve this question
add comment

1 Answer 1

up vote 1 down vote accepted

I think this tutorial on MSDN could help you: http://msdn.microsoft.com/en-us/library/hh528519(v=office.14).aspx

It goes from information about timer jobs, implementation to deployment and testing.

After deploying timer job you should re-enable feature and restart timer service:

Disable-SPFeature #feature name with timer job
net stop sptimerv4

Enable-SPFeature #feature name with timer job
net start sptimerv4

There could be issue with starting timer job manually, so it's better let it start automaticaly.

When you debug timer job don't forget to attach process to OWSTIMER instead of w3wp.

share|improve this answer
add comment

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.