Question

I have created a timer job and deployed to Sharepoint 2013 called "Timerjob Employee"

is it possible to modify my existing solution so I can create another timer job called "Timerjob Manager" (with minor differences to the original solution) and deploy to Sharepoint 2013 so I can see both jobs listed in Job Defitions in Central Administration?

Était-ce utile?

La solution

Yes, it should work! but it will require to add another feature to the second timer job "Timerjob Manager" class.


In your case, I think if you have a minor change, so I prefers

To bundle the two timer job in only one, and manage the code logic using IF condition as the following:

If(Type= "Manager")
{
    DoSomething(true);
}
else
{
   DoSomething(false);
}
void DoSomething(bool flag)
 {
   // your code
 }

Or isolate it to another solution, or manage it in one solution as I above mentioned. it's up to you :)

Autres conseils

Each timer job maps to a unique class, create another class inherit from SPJobDefinition with unique Title just like you did as existing timer job(Copy&paste and modify the proper coding part, class name, job title, timer job schedule).

You should know this, while may helpful for your reference.

Licencié sous: CC-BY-SA avec attribution
Non affilié à sharepoint.stackexchange
scroll top