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

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

Not Able Update Entity Record using Alternate Key???

(0) ShareShare
ReportReport
Posted on by 2,715

Hello All,

          I am trying to update a account record using alternate key by using the following method but i am getting error"The specified key attributes are not a defined key for the  account entity"

1.Create a accountnumber as alternate key for Account Entity and status of the same is showing Active

2.Add the below code to update a account based on the account number "ACT-12345"

// Use alternate key (accountnumber) field to identify an account record
    Entity account = new Entity("account""accountnumber""ACT-12345");
 
    // Set new credit limit;
    account["creditlimit"] = new Money(100000);
 
    // Entity reference using alternate key (emailaddress1) on contact entity
    account["primarycontactid"] = new EntityReference("contact""emailaddress1""joe@duo.com");
 
    UpdateRequest request = new UpdateRequest() { Target = account };
    UpdateResponse response = (UpdateResponse)service.Execute(request);
        But i am getting error while updating it.....

*This post is locked for comments

I have the same question (0)
  • Suggested answer
    Ramakanta Profile Picture
    2,715 on at
    RE: Not Able Update Entity Record using Alternate Key???

    Thanks Guido for quick reply..i had did a little mistake...in my config file my connection was point to another CRM instance due to which i got the error....

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…

Andrés Arias – Community Spotlight

We are honored to recognize Andrés Arias as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

#1
Community Member Profile Picture

Community Member 2

#2
Christoph Pock Profile Picture

Christoph Pock 1

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans