Wednesday, May 16, 2012

Retrieve Option Set Metadata in Microsoft Dynamics CRM 2011 Using VB.NET

This illustration shows how to retrieve an option set in Microsoft Dynamics CRM 2011 using the RetrieveOptionSetRequest.   This example will be given in VB.NET.

Ok, here is what the code look like!

First in C#:

Dim req As New RetrieveOptionSetRequest()
req.Name = "new_contactmethod"
Dim resp As RetrieveOptionSetResponse = DirectCast(service.Execute(req), RetrieveOptionSetResponse)

'Access the metadata this way
Dim osm As OptionSetMetadata = resp.OptionSetMetadata

I hope this helps!


No comments:

Post a Comment