Showing posts with the label Create Relation

retrieve,update,assign,create related object records in Microsoft CRM 2011

Hi, here is a sample of how to obtain records from CRM. You need prebuild classes from current Microsoft CRM 2011 do this use crmsvcutil.exe which comes from CRM SDK (...SDK\bin\). Built Class includes both standart Entities and Custom Entities. Usage : crmsvcutil.exe /url:http(s)://crm.???.com(:444)/organization_name/XRMServices/2011/Organization.svc /out:" \OrganizationCodes.cs " /username:muhammet.atalay /password:ILoveCrm /domain:??? /serviceContextName:...ServiceContext Do not forget to add OrganizationCodes.cs into your project. ServiceContext uses as below while retrieving any records via LinQ. ServiceContext context;            context = new ServiceContext((IOrganizationService)_serviceProxy); List contacts = context.ContactSet.Where(c => c.fieldName == criteria).ToList(); you can create a record as follow; Contact conn = new Contact(); set fields _serviceProxy.Create(booking); assign record to a user while creating record exampl