Posts

Showing posts from March, 2014

How to create simple custom SharePoint timer job

Hi, Few things to create a custom timer job. 1. Create a Feature 2. Create a .cs file and inherit SPJobDefinition and write custom code there. The SP Feature Code Behind: You can change the GUID here if it exists already or creates any issue... [ Guid ( "6ecf1f21-11fa-4109-baf7-0099347b5031" )]     public class Entropic_Top_Blog_PostsEventReceiver : SPFeatureReceiver     {         // Uncomment the method below to handle the event raised after a feature has been activated.           public override void FeatureActivated( SPFeatureReceiverProperties properties)         {             SPWebApplication webApp = properties.Feature.Parent as SPWebApplication ;               // make sure the job isn't already registered             foreach ( SPJobDefinition job in webApp.JobDefinitions)             {                 if (job.Name == "Most Recent Blog Posts" )                     job.Delete();             }             // install the job