none
Event Handler when I save or check-in Enterprise Global RRS feed

  • Question

  • I've tried building a event handler that runs on a Project Save and also a Checkin - I expected these to run when I make a change to Enterprise global, but they do not (they run correctly for projects).  Any other suggestions?  I simply want to fire code whenever there are changes to enterprise global.

     

    using System;
    using System.Diagnostics;
    using Microsoft.Office.Project.Server.Events;
    using Microsoft.Office.Project.Server.Library;
    using System.Data;
    using System.Data.SqlClient;
    using System.Configuration;
    
    namespace JohnsEventHandler
    {
      public class myClass: ProjectEventReceiver
      {
        
        public override void OnSaved(PSContextInfo contextInfo, ProjectPostEventArgs e)
    
        {
          // Create an EventLog instance and assign its source.
          EventLog myLog = new EventLog();
          myLog.Source = "Project Server Event Handler";
          // Get information from the event arguments, and 
          // write an entry to the Application event log. 
          string userName = contextInfo.UserName.ToString();
          string strProjName = e.ProjectName;
          //string strProjType = e.ProjectName
    
          
          int eventId = 3651;
          string logEntry;
    
          //e.Cancel = false;
          //string strConn = ConfigurationSettings.AppSettings["DBConnectionString"].ToString();
    
          logEntry = "User: " + userName +
              "\nProjectName: " + strProjName +
              "\nThe project was saved..."; // +
          // "\nThe db Connection is: " + strConn;
          myLog.WriteEntry(logEntry, EventLogEntryType.Information, eventId);
    
        }
    
        public override void OnCheckIn(PSContextInfo contextInfo, ProjectPostEventArgs e)
        {
          // Create an EventLog instance and assign its source.
          EventLog myLog = new EventLog();
          myLog.Source = "Project Server Event Handler";
          
          string userName = contextInfo.UserName.ToString();
          string strProjName = e.ProjectName;
    
          int eventId = 3000;
          string logEntry;
    
          logEntry = "User: " + userName +
              "\nProjectName: " + strProjName +
              "\nThe project was checked in..."; // +
          // "\nThe db Connection is: " + strConn;
          myLog.WriteEntry(logEntry, EventLogEntryType.Information, eventId);
        }
      }
    
    }
    
    

     

     

    Tuesday, April 12, 2011 2:28 AM

Answers

  • Hi John,

    There is no event handler for changing the Enterprise Global. In Project Server 2010, it is not a project, just a collection of data.


    Jim Corbin [MSFT]
    • Proposed as answer by Jim Corbin Tuesday, April 12, 2011 6:14 PM
    • Marked as answer by John W Goodson Wednesday, April 13, 2011 11:38 PM
    Tuesday, April 12, 2011 6:14 PM

All replies

  • Hi John,

    There is no event handler for changing the Enterprise Global. In Project Server 2010, it is not a project, just a collection of data.


    Jim Corbin [MSFT]
    • Proposed as answer by Jim Corbin Tuesday, April 12, 2011 6:14 PM
    • Marked as answer by John W Goodson Wednesday, April 13, 2011 11:38 PM
    Tuesday, April 12, 2011 6:14 PM
  • interesting.... thanks for the answer!

    Wednesday, April 13, 2011 11:38 PM