V
Vincenzo
Hi all,
I try to use the Project Server Events on Project Server with Beta 2
Technical Refresh. I try to change the custom fields of a project when it is
updating.
I write an EventHandler:
using System;
using Microsoft.Office.Project.Server.Events;
using Microsoft.Office.Project.Server.Library;
using System.Text;
using System.IO;
namespace TestEventHandler
{
public class UpdateProjectData : ProjectEventReceiver
{
public override void OnUpdating(PSContextInfo contextInfo,
ProjectPreEventArgs e)
{
base.OnUpdating(contextInfo, e);
try
{
//code to update e.ProjectDataSet
}
catch (Exception ex)
{
Log(ex.Message);
Log(ex.Source);
Log(ex.StackTrace);
}
e.Cancel = false;
}
}
}
The changes to the e.ProjectDataSet do not come applies to the project.
In SDK docmentation there is written:
"All events pass contextInfo, which includes the user's ID, name, and other
data for authorization checks. Some events include additional data in the e
parameter, such as a DataSet, a project ID, or other arguments in the PSI
call that triggered the event. Some events consume data modified by an event
handler; other events disregard modified data.
The Microsoft.Office.Project.Server.Events namespace includes event receiver
classes along with the pre-event and post-event argument classes and event
handler delegates. The event class descriptions show which events read
changes in the event arguments and the properties that are available. The
event arguments parameter is an object that is passed by reference.
Therefore, even though the event handler returns void, the event source gets
any changes the handler makes to the event arguments object."
Can you help me?
Thanks
Vincenzo
I try to use the Project Server Events on Project Server with Beta 2
Technical Refresh. I try to change the custom fields of a project when it is
updating.
I write an EventHandler:
using System;
using Microsoft.Office.Project.Server.Events;
using Microsoft.Office.Project.Server.Library;
using System.Text;
using System.IO;
namespace TestEventHandler
{
public class UpdateProjectData : ProjectEventReceiver
{
public override void OnUpdating(PSContextInfo contextInfo,
ProjectPreEventArgs e)
{
base.OnUpdating(contextInfo, e);
try
{
//code to update e.ProjectDataSet
}
catch (Exception ex)
{
Log(ex.Message);
Log(ex.Source);
Log(ex.StackTrace);
}
e.Cancel = false;
}
}
}
The changes to the e.ProjectDataSet do not come applies to the project.
In SDK docmentation there is written:
"All events pass contextInfo, which includes the user's ID, name, and other
data for authorization checks. Some events include additional data in the e
parameter, such as a DataSet, a project ID, or other arguments in the PSI
call that triggered the event. Some events consume data modified by an event
handler; other events disregard modified data.
The Microsoft.Office.Project.Server.Events namespace includes event receiver
classes along with the pre-event and post-event argument classes and event
handler delegates. The event class descriptions show which events read
changes in the event arguments and the properties that are available. The
event arguments parameter is an object that is passed by reference.
Therefore, even though the event handler returns void, the event source gets
any changes the handler makes to the event arguments object."
Can you help me?
Thanks
Vincenzo