Just for the quick note Microsoft CRM Online has been changes this day to authenticate MS CRM online. Below I am posting code sample that will help many of us who want work on CRM 2011 online and Office 365. Below are the Steps we need to follow it will only works for CRM 2011 online and Office 365 users.

1. Declare Username and Password of Office 365
private const String UserName = "xxx@jaxaracrm.onmicrosoft.com";
private const String Password = "12345$";
2. Get CRM User Service Instance
3. Get Authentication Types with Credential Details
AuthenticationCredentials authCredentials = new AuthenticationCredentials();
authCredentials.ClientCredentials.UserName.UserName = UserName;
authCredentials.ClientCredentials.UserName.Password = Password;
return authCredentials;

4. Call CRM Services and do the operation whatever you want create/update/delete/query with your entity

OrganizationServiceProxy organizationProxy = this.GetCRMServiceInstance();
Entity leadEntity = new Entity("lead");
leadEntity.Attributes["topic"] = topic;
return organizationProxy.Create(leadEntity);

Add new comment

Plain text

  • No HTML tags allowed.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.