This will be the first of a couple of postings about some changes in behavior that you might see once you install the December Cumulative updates. This one is specifically about the client, and the Project Information dialog. In the past if you changed a field value within the Project Information dialog then this would not raise the ProjectBeforeTaskChange or ProjectDeforeTaskChange2 events. The values in Project Information relate to the project summary task (Task 0) and in Project 2007 these events would fire regardless of where the change was made. Now, with the December CU these events are available to you. However, there are a couple of things you need to be aware of:
1. Firstly the event will fire once for the complete dialog, so unlike if you were changing values in the Project Summary task you may need to allow for and have your users prepared for multiple pop-ups (depending what you code does) once they click OK on the Project Information dialog.
2. If you cancel then you will lose all your changes – so make sure users are aware they may need to go back and check the values if for some reason your code rejected one of the changes. For example if you popped up a dialog for each change and accepted a couple then rejected one the values that had been accepted get cancelled too.
3. There appears to be a bug which we are investigating whereby the Project Department field will always raise the event even if it has not been changed.
I know that we didn’t have the issue with the Department field in 2007 – I will double check the behavior of the second bullet and see if that has also changed since 2007 – and if that should be considered a bug too.
*** Update - looks like this wasn't the behavior in 2007 - you could cancel any of the individual events and not roll back other changes - so I'd consider this a bug in 2010. No promises on any fix dates though.
One workaround to avoid cancelling if you thought the Department field had been changed would be to check if the value has actually changed – something like:
If ((Field = FieldNameToFieldConstant("Project Departments")) And (NewValue = vOldValue)) Then Exit Function
*** Update - you may also see this same issue with the Notes field.