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 );
      }
    }
  *]
}
