I had just done this
- Created a new Schema attribute called MyGroupList of DataType OptionList with 2 options in the list, Option A and Option B. The purpose being I want to further designate the group based on department.
- Added to the Market list form [Appears in creation and Edit]
- For 5 of my Market Lists I selected Option A
- Write C# code to query for contacts that belong to market lists where MygroupList = option A
Then I get the error “The given key was not present in the dictionary”.
I think this may be…
- I got the schema name wrong. I checked and well its sort of wrong in my code, I didn’t know Dynamics appends “new” to my mygrouplist. I make the change, same error.
- Perhaps the Webservice has not been updated. Restart the CRM services. Same error.
- Reboot the server, same error.
Okay, here is the problem, you have to check that there is a value for other groups, for my 50+ other groups that did not have a value when the code gets to it says “The given key was not present in the dictionary” and stops.
So I had to do an IsPresent,
If (new_mygrouplist.value = Option A)
For more info on Managing Identities in Dynamics CRM, I will be giving a presentation on the MIM Usergroup on April 11th.