protected override void ProcessRecord() { WriteObject(""); WriteObject($"FetchXML File: {FetchXmlFile}"); WriteObject($"Output Data Path: {OutputDataPath}{Environment.NewLine}"); var crmParameter = new CrmParameter(ConnectionString) { ExportDirectoryName = OutputDataPath }; var attributesToExcludeArray = AttributesToExclude?.Split(';'); string dataDir = crmParameter.GetSourceDataDirectory(); FetchXmlFile = (string.IsNullOrWhiteSpace(FetchXmlFile) || FetchXmlFile == "NULL" ? @"Veritec.Dynamics.DataMigrate.FetchQuery.xml" : FetchXmlFile); WriteObject($"Connecting ({crmParameter.GetConnectionStringObfuscated()})"); var dataExport = new DataExport(crmParameter, FetchXmlFile); WriteObject($"Fetch queries loaded {Environment.NewLine}"); foreach (var fetchXml in dataExport.FetchXmlQueries) { WriteObject($"Executing Fetch Query: {fetchXml.Key}..."); var queryResultXml = dataExport.ExecuteFetchXmlQuery(fetchXml.Key, fetchXml.Value, attributesToExcludeArray); WriteObject($"Writing Results: {dataDir}{fetchXml.Key}.xml {Environment.NewLine}"); DataExport.SaveFetchXmlQueryResulttoDisk(dataDir, fetchXml.Key, queryResultXml.ToString()); } }
protected override void ProcessRecord() { WriteObject("Transform File(s): " + string.Join("; ", TransformFiles)); WriteObject("Input Data Path: " + InputDataPath); var crmParameter = new CrmParameter(ConnectionString) { ExportDirectoryName = InputDataPath }; ExecuteImportData(crmParameter, crmParameter.GetSourceDataDirectory(), TransformFiles); if (PublishAllCustomizations) { /* some reference data needs the solution to be published for the changes to be applied * eg systemforms enitity */ PublishSolutions(crmParameter); } }