2010-08-16 37 views

回答

4

正如bjynito說,你想看看SDK,espescially有用開始外出時將是Programming Reference

下面是一個創建從a page in the programming ref.

// Set up the CRM Service. 
CrmAuthenticationToken token = new CrmAuthenticationToken(); 
// You can use enums.cs from the SDK\Helpers folder to get the enumeration for Active Directory authentication. 
token.AuthenticationType = 0; 
token.OrganizationName = "AdventureWorksCycle"; 

CrmService service = new CrmService(); 
service.Url = "http://<servername>:<port>/mscrmservices/2007/crmservice.asmx"; 
service.CrmAuthenticationTokenValue = token; 
service.Credentials = System.Net.CredentialCache.DefaultCredentials; 

// Create the contact object. 
contact contact = new contact(); 

// Create the properties for the contact object. 
contact.firstname = "Jesper"; 
contact.lastname = "Aaberg"; 
contact.address1_line1 = "23 Market St."; 
contact.address1_city = "Sammamish"; 
contact.address1_stateorprovince = "MT"; 
contact.address1_postalcode = "99999"; 
contact.donotbulkemail = new CrmBoolean(); 
contact.donotbulkemail.Value = true; 

// Create the contact in Microsoft Dynamics CRM. 
Guid contactGuid = service.Create(contact); 
0

我認爲你誤解(或我) - CRM =聯繫關係管理,但並不意味着特定的服務器/架構

例如我寫一個使用SQL Server的CRM軟件後端。如果您可以提供更多信息,我們可能會提供幫助。

+1

聽起來接觸的樣本就像他使用Microsoft Dynamics CRM – SLaks 2010-08-17 00:03:26

+0

注意自我檢查bl00dy標籤 – Basic 2010-08-17 00:34:08

0

推薦通過SDK閱讀。具體來說,查看關於可用Web服務和消息的文章。

2
using System; 
using System.Collections.Generic; 
using System.Linq; 
using System.Text; 

using Microsoft.Xrm.Client; 
using Microsoft.Xrm.Sdk.Client; 
using Microsoft.Xrm.Sdk; 
using Microsoft.Xrm.Sdk.Query; 
using Microsoft.Xrm.Client.Services; 

namespace ConsoleApplication1 
{ 
    class Program 
    { 
     static void Main(string[] args) 
     { 
      string connectionString = "Url=https://orgname.crm5.dynamics.com; [email protected]; Password=your password;"; //configure this line 

      string value = "lllllllll"; 

      AttributeCollection at = new AttributeCollection(); 
      //at.Add("fullname",(String)value); 
      at.Add("firstname", (String)"LLLL1"); 
      at.Add("lastname", (String)"ffff1"); 


      Entity ent = new Entity(); 
      ent.LogicalName = "contact"; 
      ent.Attributes=at; 
      CrmConnection connection = CrmConnection.Parse(connectionString); 
      OrganizationService organisationservice = new OrganizationService(connection); 
      Guid g = organisationservice.Create(ent); 

}}} 
相關問題