sreejithm
asked on
Updating accounts - MS CRM 2013
Hello.
I have a requirement where one of the fields of the account entity called ArabicName needs to be updated from our legacy database.
My logic is to retrieve the account based on the accountnumber and then use the below code to update the field.
Entity account = new Entity("account");
account.Attributes["accoun tnumber"] = 528580;
account.Attributes["arabic name"] = "xyz";
_service.Update(account);
However the code does not seem to work. My logic is incorrect and i feel that the record needs to be retrieved based on the GUID. Could you please provide any sample code that will help me to achieve the required functionality ?
Regards.
I have a requirement where one of the fields of the account entity called ArabicName needs to be updated from our legacy database.
My logic is to retrieve the account based on the accountnumber and then use the below code to update the field.
Entity account = new Entity("account");
account.Attributes["accoun
account.Attributes["arabic
_service.Update(account);
However the code does not seem to work. My logic is incorrect and i feel that the record needs to be retrieved based on the GUID. Could you please provide any sample code that will help me to achieve the required functionality ?
Regards.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Apologies for the delay in my response. The delay was due to some personal emergency.
Assuming that context exists and Account is a class which holds the account information.
Open in new window
Please refer http://www.dotnetcurry.com/entityframework/619/add-update-delete-objects-entity-framework and http://www.codeproject.com/Articles/37932/Simple-Sample-with-Entity-Framework for idea.