Quantcast
Channel: Microsoft Dynamics CRM Forum - Recent Threads
Viewing all articles
Browse latest Browse all 46379

Not Able Update Entity Record using Alternate Key???

$
0
0

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 = newEntity("account""accountnumber""ACT-12345");
 
    // Set new credit limit;
    account["creditlimit"] = newMoney(100000);
 
    // Entity reference using alternate key (emailaddress1) on contact entity
    account["primarycontactid"] = newEntityReference("contact""emailaddress1""joe@duo.com");
 
    UpdateRequest request = newUpdateRequest() { Target = account };
    UpdateResponse response = (UpdateResponse)service.Execute(request);
        But i am getting error while updating it.....

Viewing all articles
Browse latest Browse all 46379

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>