yanyuan
2023-11-10 143ef74e2eeee697ac8fda3d9032a790fbb4e146
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
Quintiq file version 2.0
#parent: #root
Method EnsureIntegrationDataset () as Boolean id:Method_LibDIF_GlobalState_EnsureIntegrationDataset
{
  #keys: '[146730.0.571965369]'
  Body:
  [*
    // Make sure that an Integration-dataset exists for the currently selected planning-dataset.
    // (EnsureDataset modifies the name, if applicable)
    success := false;
    
    api := this.GetIntegrationAPI();
    if( not isnull( api ) )
    {
      // Use the API-method to make sure that the dataset exists.
      api.GetIntegrationDataset();
    
      // Select the Integration-datatset.
      this.SelectIntegrationDatasetIfExists()
    
      // See if the dataset is selected in the Client.
      if( isnull( this.GetIntegrationDataset() ) )
      {
        // Try again, that usually works...
        this.SelectIntegrationDatasetIfExists();
    
        if( isnull( this.GetIntegrationDataset() ) )
        {
          datasetName := LibDIF_IntegrationDataset::GetFullName( api.GetDatasetName() );
          LibDIF_Util::Warning( "LibDIF_frmStaging.EnsureIntegrationDataset() : dataset '" + datasetName + "' of datasetkind '" + LibDIF_IntegrationDataset::DATASETKIND() + "' could not be selected." );
        }
      }
    
      success := not isnull( this.GetIntegrationDataset() );
    }
    
    return success;
  *]
}