I'm working on some C# code that interfaces with Microsoft Dynamics CRM.
At the beginning of my task, I had some code that looks like this:
Entity inquiryToCreate = new Entity("SomeEntity");
inquiryToCreate["firstname"] = "Bob";
inquiryToCreate["lastname"] = "Hunter";
_inquiryId = orgService.Create(inquiryToCreate);
This code works. However, I have a task in which I must populate a third attribute. This third attribute is picked from an optionset. Suppose that I have three possible attribute values as follows 101="Private", 102="Sergeant", 103="Petty Officer".
If Bob hunter is a Private, how do I assign the value 101="Private" to an attribute?