Click here to Skip to main content
16,016,024 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
i have an list in which i have added all the values for creating an account in Microsoft Dynamics CRM .
Every normal fields values got inserted..(eg.name,address,number) Look up value is not inserted..

i used the the following code to add value to look-up field.. However i dont get any errors..

Account acc = new Account();

acc.Attributes["name"] = "Ram"; // this values got inserted
acc.Attributes["age"] = "22"; // this values got inserted
acc.Attributes["lookupfieldid"] = "Sampletext";

service.Create(acc); // to create account

How i need to change my code in order to insert "sampletext" data into lookup fields???????.
Posted
Updated 9-Apr-14 21:08pm
v2
Comments
CoderPanda 10-Apr-14 3:29am    
After this line
acc.Attributes["lookupfieldid"] = "Sampletext";
What do you get in acc.Attributes["lookupfieldid"] ?
phil.o 10-Apr-14 4:19am    
Given that all IDs in Dynamics CRM are GUIDs, why are you trying to set it up as a string?

1 solution

You should download, install and study toroughly the SDK for Dynamics CRM that corresponds to your version.

Here you may find a good starting point:
Development for Microsoft Dynamics CRM[^]

Good luck!
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900