| Quintiq file version 2.0 | 
| #parent: #root | 
| Method CopyScenario2 ( | 
|   Scenario fromscenario, | 
|   String newscenarioname | 
| ) as stream[Void] | 
| { | 
|   Description: 'Copy scenario2 from scenario1' | 
|   TextBody: | 
|   [* | 
|     mds:=MDSMacroPlan::Create( DatasetCreateOptions::Construct( newscenarioname ).AsCopy( fromscenario.DatasetMDSID() ) | 
|                                                                                   .State( DatasetState::MemoryOnly() ) | 
|                                                                                   .Path( GlobalParameters_MP::GetDatasetFolder() ) )         | 
|      | 
|     mds->( copy ) | 
|     { | 
|       this->CreateScenarioAndLinkToMacroPlan( copy, newscenarioname )->( scenario2 ) | 
|       { | 
|         scenario2.DatasetName( newscenarioname );   | 
|       } | 
|        | 
|     }                | 
|      | 
|     return Transaction::GetCurrentTask().OnFinish(); | 
|   *] | 
|   InterfaceProperties { Accessibility: 'Module' } | 
| } |