0

I have an issue. I need to move a SharePoint external list to a custom list. After some research, I decided to use a SharePoint timer job. Not having coded in C# before all of two days ago, I immediately went looking for templates. And found two here:

Timer job for copying list items

https://gooroo.io/GoorooTHINK/Article/16938/Creating-a-Timer-Job-in-SharePoint-complete-guide/24187#.XmQiB6hKhPY

I followed the steps, and have successfully created a timer job, built it, and deployed it to the dev environment. And though it does show up in the site features, it's not doing anything.

I have two main questions:

  1. Are these the right sources to be looking at? Or is there something obviously wrong with them.
  2. What's the best way to debug a SharePoint timer job? Ultimately, I've got to be able to detect and fix these problems myself, and right now I've got no idea how to do that.
1

Timer job runs under different process, I.e owstimer.exe so in order to debug the timer job we need to attach the owstimer processor under debug menu of process tab in visual Studio,then we need to set the break point where you want in the code file, then press f5 in visual studio.

This is recommended in dev environment but while deploying this into the production server, the best way is to create a custom log function code and call this wherever you want in the timer job code file.

With these being said, I am not sure what is the business requirement for your scenario to go with timer job, even we can go with workflow approach... Timer job is preferred when we need something which should be executed automatically periodically based on the scheduler like every 5,10 minutes etc.

Timer job is invisible to the end user if this fails to run end user cannot re-run but workflow can be executed manually by the end user when it fails to run.

| improve this answer | |

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