Sample: Create, read, update, and delete lead (including UDF custom fields)

This sample code is for Microsoft Dynamics Marketing. The sample code can be found in the following location after you download and install the Microsoft Dynamics Marketing SDK:

Samples\CS\LeadSample

Requirements

Note

This sample works with your live production data. It might create real leads in your Microsoft Dynamics Marketing environment.

Demonstrates

This sample demonstrates how to create, retrieve, update, and delete a lead using Dynamics Marketing.

Example

Troubleshooting

  • If the response isn’t received in time, you’ll get the following error message:

    “The request has been sent but the response was not received. You may want to wait a few more seconds and try to receive the response again or try increasing the ResponseMessageTimeout in client.cs. “

    Some of the possible reasons why the response wasn’t received:

    • The server took longer than expected to process this response. Try selecting Option A, to see the response. If this issue occurs frequently, consider changing the value of the ResponseMessageTimeout constant in your client.cs file.

    • Either your client is looking at the wrong response queue, or Microsoft Dynamics Marketing is unable to write to the response queue due to a configuration error. To learn how to set up your queues correctly, see Getting started with the SDK.

  • If you don’t receive a response immediately, try using the Get all responses for this session option. Sometimes a response may take longer than the default time-out period.

  • If you never receive the response, make sure your request and response queue names and namespace match the details you provided on Home > Settings > Administrator > Integration Options. More information: Site configuration and integration settings.

See Also

Tasks

Quick start with sample code

Reference

Microsoft.Dynamics.Marketing.SDK.Common
Microsoft.Dynamics.Marketing.SDK.Messages
Microsoft.Dynamics.Marketing.SDK.Messages.Lead
Microsoft.Dynamics.Marketing.SDK.Model

Concepts

Developer overview of Microsoft Dynamics Marketing
Manage leads, contacts, and company
Getting started with the SDK
Sample code
Assembly included in the Microsoft Dynamics Marketing SDK

Other Resources

Programming reference for Microsoft Dynamics Marketing

Send comments about this topic to Microsoft.
© 2015 Microsoft. All rights reserved.