| Quintiq file version 2.0 | 
| #parent: #root | 
| Method EnsureImportExportDataset ( | 
|   Boolean loadIfOffline_i, | 
|   Boolean createIfNotExists_i | 
| ) as Boolean id:Method_LibCal_GlobalState_EnsureImportExportDataset | 
| { | 
|   #keys: '[131094.1.1095794000]' | 
|   Body: | 
|   [* | 
|     // Make sure that an ImportExport-dataset exists for the currently selected planning-dataset. | 
|     // (EnsureDataset modifies the name, if applicable) | 
|     ok := false; | 
|      | 
|     importExport := dhImportExport.Data(); | 
|     if( not isnull( importExport ) ) | 
|     { | 
|       datasetName := importExport.GetDatasetName(); | 
|       datasetName := LibCal_ImportExportDataset::EnsureDataset( datasetName, loadIfOffline_i, createIfNotExists_i ); | 
|      | 
|       // Select the ImportExport-datatset. | 
|       this.SelectImportExportDatasetIfExists(); | 
|      | 
|       if( isnull( LibCal_ImportExportDataset ) ) | 
|       { | 
|         // Try again, that usually works... | 
|         this.SelectImportExportDatasetIfExists(); | 
|      | 
|         if( isnull( LibCal_ImportExportDataset ) and createIfNotExists_i ) | 
|         { | 
|           LibCal_Util::Info( "LibCal_pnlImportButton.EnsureImportExportDataset() : dataset '" + datasetName + "' of datasetkind '" + LibCal_ImportExportDataset::DATASETKIND() + "' could not be selected." ); | 
|         } | 
|       } | 
|      | 
|       ok := not isnull( LibCal_ImportExportDataset ); | 
|     } | 
|      | 
|     return ok; | 
|   *] | 
| } |