hi,
I am writing the below code & facing this error on updating Project entity(The specified contract can't be set on the project because it doesn't reference the project in any of its lines).
Any Idea why???
Guid id = new Guid("7E79BA04-AE38-E811-A956-000D3A2474D1");
Entity TaskObj = (Entity)service.Retrieve("task", id, new ColumnSet(true));
Guid ProjectID = ((EntityReference)TaskObj["beg_projecttaskid"]).Id;
// EntityReference ProjectID = new EntityReference("beg_projecttaskid", TaskObj.Id);
//EntityReference ProjectID = TaskObj.GetAttributeValue<EntityReference>("beg_projecttaskid");
string Description = TaskObj["description"].ToString();
Entity projectObj = service.Retrieve("msdyn_project", ProjectID, new ColumnSet(true));
projectObj["beg_taskcompletion"] = Description;
service.Update(projectObj);
Thanks
Prashant Verma
*This post is locked for comments