Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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