Sharepoint Forum

Ask Question   UnAnswered
Home » Forum » Sharepoint       RSS Feeds

SPJobDefinition inherited class

  Asked By: Stewart    Date: Jan 26    Category: Sharepoint    Views: 1923

I am attempting to write three custom classes that extend
SPJobDefinition. The classes will be CreateTrainingSite,
SendEmailTrainingSite, and DeleteTrainingSite. I am planning on
running the CreateTrainingSite Job every five minutes and check to see
if there are any items in a specific list that are set to requested
status. If there are, the CreateTrainingSite Job will create a new
training site, create a SendEmailTrainingSite Job, and
DeleteTrainingSite Job.

All that said, I have created the class, but as a watch the debug
output, it looks like the class is not calling my custom constructor.
Also I am not getting the expected output from the Execute method. It
is not creating the other two Jobs at all.

Has anyone created a custom Timer Job class?

I can supply code and/or projects if that would help. just let me know



3 Answers Found

Answer #1    Answered By: Deven Ghurye     Answered On: Jan 26

Did you sign the code  and install the DLL in the GAC? You can't run
timer jobs  from the Bin directory.

Answer #2    Answered By: Stefanie Ruiz     Answered On: Jan 26

What do you mean by "custom constructor"?

The code  that adds the job  should call the constructor of your class
passing the appropriate values (name, server, service or web
application, lock type). And you need to update the job definition
collection and the web application/service to persist your updates.

Answer #3    Answered By: Damon Garner     Answered On: Jan 26

I found that all i needed to add was [Persisted] for the variables that i was
setting and everything pertaining to that problem now works

Didn't find what you were looking for? Find more on SPJobDefinition inherited class Or get search suggestion and latest updates.