Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>First, after creating your ASP.NET project (WebForms or MVC 3), add the following references:</p> <ol> <li>Microsoft.crm.sdk.proxy.</li> <li>Microsoft.xrm.sdk.</li> <li>System.Runtime. Serialization.</li> <li>System.ServiceModel. </li> </ol> <p>In your code-behind Create a class then add the following code:</p> <pre><code>private IOrganizationService GetCrmService(string userName, string password, string domain, Uri serviceUri) { OrganizationServiceProxy _serviceProxy; ClientCredentials credentials = new ClientCredentials(); credentials.Windows.ClientCredential = new System.Net.NetworkCredential(userName, password, domain); //credentials.UserName.UserName = userName; // uncomment in case you want to impersonate //credentials.UserName.Password = password; ClientCredentials deviceCredentials = new ClientCredentials(); using (_serviceProxy = new OrganizationServiceProxy(serviceUri, null, credentials, deviceCredentials)) { _serviceProxy.ServiceConfiguration.CurrentServiceEndpoint.Behaviors.Add(new ProxyTypesBehavior()); return (IOrganizationService)_serviceProxy; } } </code></pre> <p>If you want to retrieve multiple records:</p> <pre><code>string fetch = @"My Fetch goes here"; EntityCollection records = getCrmService().RetrieveMultiple(new FetchExpression(fetch)); </code></pre> <p>I highly recommend to download the SDK or check <a href="http://msdn.microsoft.com/en-us/library/gg334357.aspx" rel="nofollow">this</a> You'll find many samples and walkthroughs which will help you to build good portals.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload