Why IsMilestone Task property Can I set on second publication via CSOM?

Vasily Zaytsev 241 Reputation points
2022-04-18T10:50:05.223+00:00

Why IsMilestone Task property Can I set on second publication via Project server CSOM?
Hello.

Why IsMilestone Task property Can I set on second publication via Project server CSOM?

I have this code:

csom.DraftProject draft = project.CheckOut();
context.Load(draft.Tasks, dt => dt.Where(t => t.Id == taskUID));
context.ExecuteQuery();
csom.DraftTask task = draft.Tasks.First();
task.ActualStart = task_Act_Start;
task.ActualFinish = task_Act_Start;
task.PercentComplete = 100;
task.IsLockedByManager = true;
task.IsMilestone = true;
draft.Update();
csom.JobState jobState = context.WaitForQueue(draft.Publish(true), Consts.DEFAULTTIMEOUTSECONDS);

BUT task.IsMilestone = true; works only after second publication:

csom.DraftProject draft = project.CheckOut();
context.Load(draft.Tasks, dt => dt.Where(t => t.Id == taskUID));
context.ExecuteQuery();
csom.DraftTask task = draft.Tasks.First();
task.IsMilestone = true;
draft.Update();
csom.JobState jobState = context.WaitForQueue(draft.Publish(true), Consts.DEFAULTTIMEOUTSECONDS);

How can I do it with one publication?

SharePoint Server
SharePoint Server
A family of Microsoft on-premises document management and storage systems.
2,273 questions
SharePoint Server Development
SharePoint Server Development
SharePoint Server: A family of Microsoft on-premises document management and storage systems.Development: The process of researching, productizing, and refining new or existing technologies.
1,591 questions
{count} votes

Accepted answer
  1. RaytheonXie_MSFT 32,636 Reputation points Microsoft Vendor
    2022-04-20T01:05:39.083+00:00

    Hi @Vasily Zaytsev ,
    Since your issue is about Project online. Microsoft has a dedicated forum to discuss about Project online. You can get some more professional advice in the forum.
    https://techcommunity.microsoft.com/t5/project/ct-p/Project


    If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.



1 additional answer

Sort by: Most helpful
  1. Vasily Zaytsev 241 Reputation points
    2022-04-20T14:58:37.747+00:00

    Hi @RaytheonXie_MSFT ,
    First, I send this question on dedicated forum, but there is no answer.

    0 comments No comments