How to create early bound class for crm?

For this use to CrmSvcUtil.exe. Go to sdk folder (D:\Libraries\MS Dynamics CRM SDK\SDK\Bin) my version 7.1.1.xx

Create a sample bat file, create.bat. Open text editor and put this.

For AD Crm

CrmSvcUtil.exe /url:https://url/organiztionname/XRMServices/2011/Organization.svc    /out:CrmObjects.cs /username:yourusername /password:yourpassword /domain:yourdomain    /namespace:CrmEntityClasses /serviceContextName:CrmEntityContext

For IFD Crm

CrmSvcUtil.exe /url:https://url/XRMServices/2011/Organization.svc     /out:CrmObjects.cs /username:domain\yourusername /password:yourpassword

Run the create.bat file, after then created CrmObjects.cs

Copy to your project and create the context object


CrmEntityClasses.CrmEntityContext  context = new CrmEntityClasses.CrmEntityContext(service)

“service” object must be inherit IOrganizationService !

Lets try to simple code


var list = from z in context.ContactSet select z;

#crm-entity-class, #crmutilsvc, #dynamics-crm, #early-bound, #entity-class

Advertisements