Question

I am working on writing an event handler that handles the OnSending event of Project Server in 2010. I am very new to writing event handlers in MS Project and require your help in getting started on it..I have Googled, but did not find any good resources on it. I know this is kind of vague question, but would request you experts to help me to get started with this.

Thanks in advance!

Was it helpful?

Solution

Here is a good article that should help you get started: http://msdn.microsoft.com/en-us/library/gg615466.aspx

Also - I would download the Project Server 2010 SDK: http://msdn.microsoft.com/en-us/library/ms512767.aspx

The SDK contains alot of good references and will provide you with other examples of how to access Project Server Data via the PSI.

Finally, Event Handlers are difficult to troubleshoot. When you deploy to an environment off your development machine and need to troubleshoot, I would recommend taking advantage of SharePoint's ULS log's. Your Project Server event handler can write to these logs too.

Here is a method that I use to catch errors and issues:

    internal static void writeULS(string traceValue)
    {
        SPDiagnosticsService diagSvc = SPDiagnosticsService.Local;

        diagSvc.WriteTrace(0, // custom trace id
        new SPDiagnosticsCategory("YOUR ULS LOG CATEGORY NAME (IE//COMPANY.APP)",
        TraceSeverity.Monitorable,
        EventSeverity.Information), // create a category    
        TraceSeverity.Monitorable, // set the logging level of this record    
        "{0}", // custom message    
        new object[] { traceValue } // parameters to message
        );
    }
Licensed under: CC-BY-SA with attribution
Not affiliated with sharepoint.stackexchange
scroll top