Anty,
My company also asked me to implement this.
There are two reasons why they are asking for this.
1) All the project managers will be doing this update at the end of the
week and the project server is going on knees as there are around
100-150 projects(This may increase further). And most of the times the
project professional is getting crashed because of this.
2) They have resources managers who approve timesheets and they really
dont want project manager to involve in this process. Also, project
managers are not doing the updates if they are asked to do that
manually. Because of which the 3rd party application and project server
are becoming out of synch.
This is a critical requirement for them, instead of my recommendation
that it is not recommended by microsoft and is not good to do also.
So i started looking for some ways to automate this.
I am just putting my ideas (whatever i have explored till now)
I thought it can be accomplished in 2 ways
1) Using project server object model.
2) Modifying the database directly.
I really dont want to go for the the second option. As it may lead to
database incosistencies.
So i started exploring the first option.
I have created a windows application using C# and accomplished the
following.
1) Added the project object library to the windows application
2) opened the project professional
For each project in the project server database performed the following
3) Opened a project on the server.
4) Update the actuals into project plan(This is not yet accomplished.
See the comments below)
5) Rescheduled the remaining work
6) published the project
7) closed the project
Except point 4 i could implement other things. (ofcourse that is the
crucial one)
And regarding the updating actuals into project plan.
I have found 2 methods in SDK which seem to be doing this
functionality.
I) EnterpriseSynchActuals -- this method i have used in the code and
is running without error but no impact on the project plan. I guess
this might be synchronizing the out of synch actuals.
ii) updatefromprojectserver -- This method seems to be the one which
does the updates from project server to project plan. It expects
datafile as string as an argument. I dont know what this datafile is. I
have searched on groups but with no help. I tried giving all possible
random values (eg: empty string, list of WASSN_ID's etc.). But it
throws an exception saying 'The argument value is invalid'
So i am a bit struck up at this point.
And then i have decided to observe how the updates are done in the
updates page of PWA.
They are using pjUpdate.ocx control to do this.
The exact method is pjUpdate.UpdateTransactions(bool,int) in the file
tasktransactions.asp.
I have verified using alert statements, that this single line of code
is doing all the actions like opening the project professional, opening
the project and updating the actuals and then saving the project plan.
I thought of accessing the same function from my C# code.
I have added the pjUpdate11.ocx control to my windows application and
accessed the method with some dummy data, which i have filled using the
view source of updates page in PWA.
But this method returns a status of -212472345 (some big number) and
doing nothing.
Ofcourse if we can make it to work this way also, it expects user
cookies and also update projects related one resource. It is not
possible to login with each and every user and pass the coockie values.
And also we have no control over the project professional windows
opening. If it tries to open 100 project professional instances at a
time, this will definitely fail.
So now i am almost struck here.
Still looking for some options optimistically.
Note: Personally I dont want to do all these things. If i am successful
at achieving the 4th step also, the solution looks so wierd and it has
high probability of failure as we are trying to open 100s of project
one by one and there can be memory problems or there can be popup
messages in between. But i am forced to do this, as my company want to
go away from project server if this is not accomplished.
The good part of it is that, Microsoft is coming up with client side
cache and server side events in the next version (see dieter's blog),
using which this can be done nicely.
And also the sad part of it is, it is going to be released only at the
end of this year, until which the clients cannot wait.
Hope to hear any thoughts & suggestions from all.
Thanks & regards
Sudhakar