kanchan
kanchan

Reputation: 11

Retrieve CRM 2011 subject tree values in Windows application

How can we retrieve subject tree values of CRM 2011 into C# windows application and store in in a DropDownList or ComboBox?

Upvotes: 0

Views: 1086

Answers (2)

Graham Davis
Graham Davis

Reputation: 11

You can use a normal RetrieveMultiple:

_serviceProxy.EnableProxyTypes();
_service = (IOrganizationService)_serviceProxy;
_service.RetrieveMultiple(new FetchExpression("fetchxml here"));

You will not be able to use advanced find to search for subject, but the entity exists and can be queried using fetch. Here is an example:

<fetch version='1.0' output-format='xml-platform' mapping='logical' distinct='false'>
  <entity name='subject'>
    <attribute name='title' />
    <order attribute='title' descending='false' />
  </entity>
</fetch>

You will then have an EntityCollection which you can use in your code as required.

Upvotes: 1

Konrad Viltersten
Konrad Viltersten

Reputation: 39250

  1. Connect to the server.
  2. Retrieve the information needed (query string is your friend).
  3. Filter the data to fit your purpose.
  4. Deliver the array to your application.
  5. Create a new GUI component.

Are you clear on how to perform each of the steps codewise?

Upvotes: 0

Related Questions