Hi,
I am trying to allocate resource to a task in Dynamics 365 programmatically. The code is:
private static void AssignResourceToTask(XrmServiceContext xrm)
{
Guid TaskId = new Guid("40e1f9d7-9e8d-4d18-8d0d-08e8ec6ccb4b");
Guid ResourceId = new Guid("30cd5482-94d1-e611-80e7-c4346bacbf10");
Guid ProjectId = new Guid("666609d2-9510-e711-ae87-002713bd9b28");
var AssignResource = new msdyn_resourceassignment
{
msdyn_resourceassignmentId = Guid.NewGuid(),
msdyn_bookableresourceid = new Microsoft.Xrm.Client.CrmEntityReference("bookableresource", ResourceId),
msdyn_taskid = new Microsoft.Xrm.Client.CrmEntityReference("msdyn_projecttask", TaskId),
msdyn_projectid = new Microsoft.Xrm.Client.CrmEntityReference("msdyn_project", ProjectId)
};
xrm.AddObject(AssignResource);
xrm.SaveChanges();
}
But I am unable to assign resource to a task using the above code.
*This post is locked for comments
Stay up to date on forum activity by subscribing. You can also customize your in-app and email Notification settings across all subscriptions.
André Arnaud de Cal... 291,240 Super User 2024 Season 2
Martin Dráb 230,149 Most Valuable Professional
nmaenpaa 101,156