web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

The specified contract can't be set on the project because it doesn't reference the project in any of its lines.

(0) ShareShare
ReportReport
Posted on by 287

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

I have the same question (0)

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

#1
SA-08121319-0 Profile Picture

SA-08121319-0 4

#1
Calum MacFarlane Profile Picture

Calum MacFarlane 4

#3
Alex Fun Wei Jie Profile Picture

Alex Fun Wei Jie 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans