Skip to content

Instantly share code, notes, and snippets.

@andz88
Created October 10, 2016 06:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save andz88/18299a890d3bf272e0cea80bde995439 to your computer and use it in GitHub Desktop.
Save andz88/18299a890d3bf272e0cea80bde995439 to your computer and use it in GitHub Desktop.
public static void CreateTestDrive(TestDriveDetail testDrive, IOrganizationService crmService)
{
var lead = new Microsoft.Xrm.Sdk.Entity(EntityName);
//lead.Attributes
lead.Attributes.Add(Field_Subject, $"Test Drive Request by {testDrive.CustomerName}");
lead.Attributes.Add(Field_FirstName, testDrive.CustomerName);
lead.Attributes.Add(Field_Description, $@"Test drive request summary:
{Environment.NewLine}Car Make: {testDrive.CarMake},
{Environment.NewLine}Car Model: {testDrive.CarModel},
{Environment.NewLine}Requested Time: {testDrive.RequestedTime},
{Environment.NewLine}Customer Name: {testDrive.CustomerName},
{Environment.NewLine}Phone Number: {testDrive.PhoneNumber}");
crmService.Create(lead);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment