Quintiq file version 2.0
#parent: #root
Method CopyScenario (
  Scenario selection,
  internal[GUIComponent] parent
) as Scenario id:Method_ScenarioManager_DialogCreateEditMPScenario_CopyScenario
{
  #keys: '[11122.0.45744572]'
  Body:
  [*
    // Copy scenario
    this.SetCopyData( selection );
    newscenario := null ( Scenario );
    
    result := this.DoModal( parent );
    
    if ( result > 0 )
    {
      newscenario := this.CopyScenario( selection, 
                                        EditorScenarioName.Text(), 
                                        EditorAssumption.Text(), 
                                        EditorComment.Text(), 
                                        RadioButtonGroupStorageState.BoundValue(), 
                                        RadioButtonGroupMode.BoundValue() );
                                        
      if( not isnull( SelectionStrategy.Data() ) )
      {
        newscenario.SelectedStrategy( relset, SelectionStrategy.Data() );
      }                                
    }
    
    return newscenario;
  *]
}
