簡體   English   中英

Microsoft Dynamics CRM 2011:如何從外部聯系表單生成潛在客戶

[英]Microsoft dynamics CRM 2011: how to generate lead from external contact form

我為我的一位客戶開發了 CMS,他希望當用戶填寫聯系表格時,它會自動在他的 CRM 中生成潛在客戶。 最簡單的方法是什么?

順便說一句,聯系表格是 ajax 並且數據被傳輸到 asmx,所以很容易調用 CRM webservice 或類似的東西,因為我已經在服務器端。

有人可以指點我教程或一些代碼示例嗎? 謝謝!

您最好的開始將是 SDK 此處可用,其中包含示例代碼和 sdk dll 等...

是一個快速參考的頁面,其中包含所有 web 服務端點在不同風格的 CRM 2011 中可用的快速參考。

來自 SDK samplepcode\cs\quickstart 創建帳戶,但對於潛在客戶非常相似:

            // Connect to the Organization service. 
            // The using statement assures that the service proxy will be properly disposed.
            using (_serviceProxy = new OrganizationServiceProxy(serverConfig.OrganizationUri,
                                                                serverConfig.HomeRealmUri,
                                                                serverConfig.Credentials,
                                                                serverConfig.DeviceCredentials))
            {
                // This statement is required to enable early-bound type support.
                _serviceProxy.ServiceConfiguration.CurrentServiceEndpoint.Behaviors.Add(new ProxyTypesBehavior());

                // Instaniate an account object.
                // See the Entity Metadata topic in the SDK documentation to determine 
                // which attributes must be set for each entity.
                Account account = new Account { Name = "Fourth Coffee" };

                // Create an account record named Fourth Coffee.
                _accountId = _serviceProxy.Create(account);
                Console.Write("{0} {1} created, ", account.LogicalName, account.Name);

                // Retrieve the account containing several of its attributes.
                ColumnSet cols = new ColumnSet(
                    new String[] { "name", "address1_postalcode", "lastusedincampaign" });

                Account retrievedAccount = (Account)_serviceProxy.Retrieve("account", _accountId, cols);
                Console.Write("retrieved, ");

                // Update the postal code attribute.
                retrievedAccount.Address1_PostalCode = "98052";

                // The address 2 postal code was set accidentally, so set it to null.
                retrievedAccount.Address2_PostalCode = null;

                // Shows use of a Money value.
                retrievedAccount.Revenue = new Money(5000000);

                // Shows use of a boolean value.
                retrievedAccount.CreditOnHold = false;

                // Update the account record.
                _serviceProxy.Update(retrievedAccount);
                Console.WriteLine("and updated.");

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM