Skip to main content

Notifications

Announcements

No record found.

Project Operations forum
Suggested answer

Update Task Entity

Posted on by 5

Hi 

I am looking at some example/payload which will help me update effort_completed field. so far I have this code. However, when I use this code. Nothing happens.

Can anyone please help me with the below code ? 

OrganizationRequest organizationRequest = new OrganizationRequest("msdyn_CreateOperationSetV1");
organizationRequest["ProjectId"] = ProjectId;
organizationRequest["Description"] = ProjectId;
response = orgService.Execute(organizationRequest);
string opSetId = response["OperationSetId"].ToString();

OrganizationRequest organizationRequest1 = new OrganizationRequest("msdyn_PssUpdateV1");
var projEntity = new Entity("msdyn_project", Guid.Parse(ProjectId));
var newTask = new Entity("msdyn_projecttask", Guid.Parse(taskId));
newTask["msdyn_project"] = projEntity.ToEntityReference();
newTask["msdyn_effortcompleted"] = decimal.Parse("400");
//newTask["msdyn_start"] = DateTime.Today.AddDays(1);
organizationRequest1["Entity"] = newTask;
organizationRequest1["OperationSetId"] = opSetId;
var response1 = orgService.Execute(organizationRequest1);

  • GLMSDev Profile Picture
    GLMSDev 10 on at
    RE: Update Task Entity

    Thanks this actually worked

  • Suggested answer
    apa Profile Picture
    apa 8,280 on at
    RE: Update Task Entity

    I can't see a line where you'd execute the OperationSet with msdyn_ExecuteOperationSetV1. Could that be it?

Helpful resources

Quick Links

Replay now available! Dynamics 365 Community Call (CRM Edition)

Catch up on the first D365 Community Call held on 7/10

Community Spotlight of the Month

Kudos to Saurav Dhyani!

Congratulations to the June Top 10 community leaders!

These stars go above and beyond . . .

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 288,459 Super User

#2
Martin Dráb Profile Picture

Martin Dráb 225,783 Super User

#3
nmaenpaa Profile Picture

nmaenpaa 101,148

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans