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);
*This post is locked for comments
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....
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,188 Super User 2024 Season 2
Martin Dráb 230,030 Most Valuable Professional
nmaenpaa 101,156