yypsybs
2023-10-10 550ebcf02217f8a0c6fe9001fcfa8e42e9cd6b83
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
Quintiq file version 2.0
#parent: #root
Method SelectScenarioReadOnly (
  Scenario scenario,
  internal[GUIComponent] component
) id:Method_ApplicationLibMacroPlanner_SelectScenarioReadOnly_386
{
  #keys: '[144528.3.491343998]'
  Body:
  [*
    // Select the active macroplan based on passed in scenario
    // Set active macroplan to the passed in component (Form)
    // ComponentMDS::Create( Application ) is not available in Editor -- still finding, if exist, all this code will be moved.
    
    if( not isnull( scenario ) )
    {
      editor := ExternalMDSEditor::Editor();
      allinfo := editor.LoadedObjectInfos();
    
      mdsInfo := select( allinfo, Elements, oinfo,
                         not isnull( oinfo.MDSID() )
                         and oinfo.MDSID().MDSKey() = scenario.DatasetMDSID()
                         or oinfo.Name() = scenario.DatasetName() );
    
    
      if( not isnull( mdsInfo ) )
      {
        this.ComponentMDS_SelectInstance( component, scenario );
      }
    }
  *]
}