Uploading project task notes and remaining work

E

Esfer

Hi

I'm trying to change remaining work and notes in a task but I'm having
several problems.

The first is that field "TASK_NOTES" is read only so I can't change its
content.

Anyway I've tried to change "TASK_REM_WORK" and it seems to work fine but
with no effects :-(. I mean I can change its value but changes doesn't
persist.

I tried to update the project data after changing that task row but it
doesn't work (Exception is thrown).

My code is here:

--------------------
taskRow = projectDS.Task.FindByTASK_UIDPROJ_UID(task.ProjectServerTaskGuid,
task.ProjectServerProjectGuid);

taskRow["TASK_REM_WORK"] = task.Remaining * 60000;
projectDS.AcceptChanges();

//taskRow["TASK_NOTES"] = task.Note;

taskRow.AcceptChanges();

projectWS.QueueUpdateProject(Guid.NewGuid(), Guid.NewGuid(),
projectDS, false);
--------------------

The last line is the one throwing the exception, even if I don't change
anything before the call... The PSIClientError sais it is a "ErrorIndex" but
I have no more information...

Any ideas? Thanks in advance ;-)
 
E

Esfer

Ok now I can run the "QueueUpdateProject" by CheckingIN and CheckingOUT the
project but every fields remain with previous values :-(.

And I'd like to know how to change notes too, of course hehehehe.
 
S

Stephan Steiner

Esfer

This link might come in handy for the task notes:
http://blogs.msdn.com/lduff/archive/2006/08/28/728918.aspx

Basically you need to throw caution to the wind and write changes directly
to the database. We do this in Project Server 2003 where it works, however
there is a bug in the project client that makes it choke on many of those
updates (it throws and error then cancels out the notes). I don't know how
Project Server 2007 will handle that but when we migrate I'll propose that
we forget about the task notes since we don't know how the scheduling engine
will react to potential problems with that field.

And as for the remaining work.. we write into that field as well directly
via database in Project Server 2003. We however pretend to be a resource and
make the changes in the published tables (MSP_WEB_ASSIGNMENTS) and virtually
submit a timesheet change. Since we have fixed work tasks, this works.
Things get problematic though if you update more than one value of the
infamous triangle (work, duration, units) - project client will recalculate
the others accordingly the next time it enters into account (e.g. the next
approval process). We found that if you update Remaining_Work, it could have
some negative sideeffects in certain instances, e.g. leading to having
actual work > 0 even though no actuals had been reported, and recalculating
work based on changes on remaining work also proved to be problematic (all
done via database mind you).

What you definitely can do is open the project in the project client and
make changes there, then save and publish.

Regards
Stephan

Esfer said:
Ok now I can run the "QueueUpdateProject" by CheckingIN and CheckingOUT
the
project but every fields remain with previous values :-(.

And I'd like to know how to change notes too, of course hehehehe.

Esfer said:
Hi

I'm trying to change remaining work and notes in a task but I'm having
several problems.

The first is that field "TASK_NOTES" is read only so I can't change its
content.

Anyway I've tried to change "TASK_REM_WORK" and it seems to work fine but
with no effects :-(. I mean I can change its value but changes doesn't
persist.

I tried to update the project data after changing that task row but it
doesn't work (Exception is thrown).

My code is here:

--------------------
taskRow =
projectDS.Task.FindByTASK_UIDPROJ_UID(task.ProjectServerTaskGuid,
task.ProjectServerProjectGuid);

taskRow["TASK_REM_WORK"] = task.Remaining * 60000;
projectDS.AcceptChanges();

//taskRow["TASK_NOTES"] = task.Note;

taskRow.AcceptChanges();

projectWS.QueueUpdateProject(Guid.NewGuid(), Guid.NewGuid(),
projectDS, false);
--------------------

The last line is the one throwing the exception, even if I don't change
anything before the call... The PSIClientError sais it is a "ErrorIndex"
but
I have no more information...

Any ideas? Thanks in advance ;-)
 
E

Esfer

Thanks for your answer :-D

I think this should be supported by PSI... it's a really important feature :-S

Thanks!!

Stephan Steiner said:
Esfer

This link might come in handy for the task notes:
http://blogs.msdn.com/lduff/archive/2006/08/28/728918.aspx

Basically you need to throw caution to the wind and write changes directly
to the database. We do this in Project Server 2003 where it works, however
there is a bug in the project client that makes it choke on many of those
updates (it throws and error then cancels out the notes). I don't know how
Project Server 2007 will handle that but when we migrate I'll propose that
we forget about the task notes since we don't know how the scheduling engine
will react to potential problems with that field.

And as for the remaining work.. we write into that field as well directly
via database in Project Server 2003. We however pretend to be a resource and
make the changes in the published tables (MSP_WEB_ASSIGNMENTS) and virtually
submit a timesheet change. Since we have fixed work tasks, this works.
Things get problematic though if you update more than one value of the
infamous triangle (work, duration, units) - project client will recalculate
the others accordingly the next time it enters into account (e.g. the next
approval process). We found that if you update Remaining_Work, it could have
some negative sideeffects in certain instances, e.g. leading to having
actual work > 0 even though no actuals had been reported, and recalculating
work based on changes on remaining work also proved to be problematic (all
done via database mind you).

What you definitely can do is open the project in the project client and
make changes there, then save and publish.

Regards
Stephan

Esfer said:
Ok now I can run the "QueueUpdateProject" by CheckingIN and CheckingOUT
the
project but every fields remain with previous values :-(.

And I'd like to know how to change notes too, of course hehehehe.

Esfer said:
Hi

I'm trying to change remaining work and notes in a task but I'm having
several problems.

The first is that field "TASK_NOTES" is read only so I can't change its
content.

Anyway I've tried to change "TASK_REM_WORK" and it seems to work fine but
with no effects :-(. I mean I can change its value but changes doesn't
persist.

I tried to update the project data after changing that task row but it
doesn't work (Exception is thrown).

My code is here:

--------------------
taskRow =
projectDS.Task.FindByTASK_UIDPROJ_UID(task.ProjectServerTaskGuid,
task.ProjectServerProjectGuid);

taskRow["TASK_REM_WORK"] = task.Remaining * 60000;
projectDS.AcceptChanges();

//taskRow["TASK_NOTES"] = task.Note;

taskRow.AcceptChanges();

projectWS.QueueUpdateProject(Guid.NewGuid(), Guid.NewGuid(),
projectDS, false);
--------------------

The last line is the one throwing the exception, even if I don't change
anything before the call... The PSIClientError sais it is a "ErrorIndex"
but
I have no more information...

Any ideas? Thanks in advance ;-)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top