Adding a task and setting the start date

G

Gerardv

Hi,

I am new to the dev thread and hope someone can help with the following:
I am looking to implement some automation using the Project Server PSI. The
documentation on msdn is helpful and all seem to work just fine when I try
creating a project and adding some tasks using the code examples.

However, the start date of a task is always the same. I.e. the date the
project is created. No matter what you set for ".TASK_START_DATE".
E.g. in the code example on
http://msdn2.microsoft.com/en-us/library/websvcproject.project.queuecreateprojectandcheckout.aspx.

MS uses: taskOne.TASK_START_DATE = System.DateTime.Now.AddDays(1);

Does not matter what I put in there (my own date, 20 instead of 1), I always
get the same start date. Setting the duration with ".TASK_DUR" does work. I
have played around with it but can't find a way to set the start date.

Hope someone can help?

Thanks,
Gerard







do
 
G

Gerardv

I figured it out. Funny how writing out an issue helps you find solutions.

Still think that the code example needs to be rewritten :).

Cheers,
Gerard
 
S

Snowball9999

I struggled with this when I first got started working with the Project PSI
as well. In order to set a specific start date or a specific finish date,
you will have to set a constraint. So you will set a constraint type
(attribute of taskOne) of probably StartNoEarlierThan and then set the
constraint date for the date that you want the task to start on.
 
G

Gerardv

Yep, that's what I found.

Thanks for the reply though! It is good to get it confirmed.

I set it to:
newTask.TASK_CONSTRAINT_TYPE = 2;
newTask.TASK_CONSTRAINT_DATE = dateMystartdate;

but will try your suggestion of "StartNoEarlierThan" (4)

Cheers,
Gerard
 
C

Chris Boyd

Whenever you call QueueUpdateProject, QueueAddtoProject or
QueueDeleteProject, we reschedule the project after appling the changes. The
reason that this is happening, is that we have a server side scheduling
engine in PS2007, so the scheduling engine is moving the start date of the
task to the start of the project since there is no constraint set on it.


--
Chris Boyd
MS Project
Program Manager

Blog: http://blogs.msdn.com/project_programmability/
 

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