I need to automate the Dynamics CRM Import Wizard that currently lets you zip up Accounts and Contacts files together and import them into CRM all at once as per the screen shot below.
We have quite a few zip files to import so thought it might be wise to automate this using the Dynamics CRM SDK. Looking in the SDK I can find an example of importing entity files 1 by 1 such as here but no examples of importing them together in a zip file? Is this possible and if so are there any examples of this? For instance the SDK code below looks at an "Import Accounts.csv" file only but I really need something to handle an "Import Accounts and Contacts.zip".
// Create Import File.
ImportFile importFile = new ImportFile()
{
Content = BulkImportHelper.ReadCsvFile("Import Accounts.csv"), // Read contents from disk.
Name = "Account record import",
IsFirstRowHeader = true,
ImportMapId = new EntityReference(ImportMap.EntityLogicalName, importMapId),
UseSystemMap = false,
Source = "Import Accounts.csv",
SourceEntityName = "Account_1",
TargetEntityName = Account.EntityLogicalName,
ImportId = new EntityReference(Import.EntityLogicalName, importId),
EnableDuplicateDetection = false,
FieldDelimiterCode =
new OptionSetValue((int)ImportFileFieldDelimiterCode.Comma),
DataDelimiterCode =
new OptionSetValue((int)ImportFileDataDelimiterCode.DoubleQuote),
ProcessCode =
new OptionSetValue((int)ImportFileProcessCode.Process)
};