Quintiq file version 2.0
#parent: #root
Method NewScenarioFromDataset (
  shadow[Dataset] dataset
) id:Method_DialogCreateEditScenario_NewScenarioFromDataset
{
  #keys: '[134266.1.2048886242]'
  Body:
  [*
    // New scenario
    scenarioManager := ScenarioManager;
    
    scenariofolder := select( scenarioManager, ScenarioNode.astype( ScenarioFolder ), folder,
                              folder.Name() = GlobalParameters_MP::GetFolderRoot() );
    
    strategy := select(ScenarioManager, Strategy, strategy, strategy.Name() = Translations::MP_GlobalParameters_DefaultStrategyName() );
    
    scenario := ScenarioManager.ScenarioNode( relshadow,
                                              ScenarioMP,
                                              Parent := scenariofolder,
                                              Name := dataset.Name(),
                                              SelectedStrategy := strategy,
                                              DatasetName := dataset.Name(),
                                              DatasetMDSID := dataset.DatasetMDSID(),
                                              State := dataset.State() );
    
    DataHolderActionCopy.Data( false );
    DataHolderDialogData.Data( &scenario );
    
    ApplicationMacroPlanner.ShowFormModal( this );
  *]
}
