الأربعاء، 29 يناير 2014

How to use linq with crm 2011 plugin


create XrmServiceContext class
  a- run command prompt 
  b-write the following command "cd C:\Program Files\Microsoft Dynamics CRM\tools" then press enter
  c- write the following command then press enter
        CrmSvcUtil.exe /out:Xrm.cs /url:http://serverName/OrgName/XRMServices/2011/Organization.svc /domain:domainName /username:YourUserName /password:yourPassword /namespace:Xrm /serviceContextName:XrmServiceContext

       (Note:replace the red words with your CRM login configuration)
  d- go to the following path "C:\Program Files\Microsoft Dynamics CRM\tools" and copy "Xrm.cs" file then past to your project.

using (var crm = new XrmServiceContext(service))
 {
       var QuoteProduct = crm.QuoteDetailSet.Where(c => c.QuoteDetailId == QPID).First();
       foreach((var item in QuoteProduct)
      {

      }
}



ليست هناك تعليقات:

إرسال تعليق