admin
2025-01-22 7e31442f0e9b07764e9c6a9680d3d4aeba5fe1de
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
Quintiq file version 2.0
#parent: #root
Method CanSelect (
  output String feedback_o,
  Boolean isdatasetstoreenabled
) declarative remote as Boolean
{
  Description: 'Whether selecting a scenario online is possible or not'
  TextBody:
  [*
    // derred, [dataset-store storage]
    /* Not allowed to select a scenario if:
    1. Scenario dataset is loading in progress [ Loading is now Async ]
    2. Storage state is Dataset-Store storage, but the dataset store is not enabled
    */
    
    if( this.IsLoadingInProgress() )
    {
      feedback_o := Translations::Scenario_CanSelect_LoadingInProgress();
    }
    else if( this.IsDatasetStoreStorage()
              and not isdatasetstoreenabled )
    {
      storageState := this.State().ReplaceAll( GlobalParameters_MP::GetStringStorageState(), "" );
      feedback_o := Translations::Scenario_CanSelect_DatasetStoreNotEnabled( this.Name(), storageState );
    }
    else if( not this.IsLoaded() )
    {
      feedback_o := Translations::Scenario_General_IsNotLoaded();
    }
    else if( this.IsDeleted() ) // #11026
    {
      feedback_o := Translations::Scenario_General_IsDeleted();
    }
    
    return feedback_o = '';
  *]
}