动态CRM试用登录与.NET集成

时间:2014-06-05 13:33:17

标签: dynamics-crm-2011 dynamics-crm crm dynamics-crm-4

我需要创建POC应用程序,它可以从.NET调用Dynamic CRM。目前,我没有CRM实际账户,在POC之后它将是avaibale。

任何人都可以分享我怎么可能吗?通过试用登录CRM并允许创建账户是可能的吗?

2 个答案:

答案 0 :(得分:2)

首先从此处启动Dynamics CRM Online试用版:

http://www.microsoft.com/en-us/dynamics/crm-free-trial-overview.aspx

从此处下载最新的CRM 2013 SDK后:

http://www.microsoft.com/en-us/download/details.aspx?id=40321

您可以使用此代码(简化连接)连接并创建帐户:

CrmConnection crmConnection = CrmConnection.Parse("Url=https://XXX.crm.dynamics.com; Username=user@domain.onmicrosoft.com; Password=passwordhere;");
OrganizationService service = new OrganizationService(crmConnection);

Entity account = new Entity("account");
account["name"] = "Test Account";

Guid accountId = service.Create(account); 

请参阅此msdn文章,以创建正确的连接字符串

Simplified Connection to Microsoft Dynamics CRM

答案 1 :(得分:0)

Guido给出了一个很好的起点。我只是添加一个关于早期生成的注释,因为这是大多数人习惯/想要的。 Guido的示例代码使用Late Bound Entity类。使用early bound generator根据您的CRM自定义创建类型化实体,并在项目中引用它们。这会改变Guido的代码示例:

CrmConnection crmConnection = CrmConnection.Parse("Url=https://XXX.crm.dynamics.com; Username=user@domain.onmicrosoft.com; Password=passwordhere;");
OrganizationService service = new OrganizationService(crmConnection);

Account account = new Account{
    Name = "Test Account",
};
account.Id = service.Create(account);