D365FO – AX – Import CSV file into a Table with RecordInsertList for best DB insert performance

static void ImportWithStreamReader(Args _args) { //Declarations Filename filename = @'C:\file.txt'; System.IO.StreamReader reader; System.String line; InteropPermission interopPermission; container con; str itemId; str startDate; str qty; str inventDimId; str modelId = 'NIC'; InventDimId inventDimIdDefault = 'XXX-000614941'; ForecastSales forecastSales; ForecastInvent forecastInvent; RecordInsertList insertListForecastSales = new RecordInsertList(ForecastSales.TableId); RecordInsertList insertListForecastInvent = new RecordInsertList(ForecastInvent.TableId); int recordsCurrentlyInsertedForecastSales, recordsCurrentlyInsertedForecastInvent; interopPermission = new InteropPermission(InteropKind::ClrInterop); … Continue reading D365FO – AX – Import CSV file into a Table with RecordInsertList for best DB insert performance