admin
2025-01-22 7e31442f0e9b07764e9c6a9680d3d4aeba5fe1de
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
Quintiq file version 2.0
#parent: #root
Method Copy (
  String newscenarioname,
  Scenario scenario
) as String
{
  Description: 'Create a copy of the selected scenario'
  TextBody:
  [*
    // ying ying Mar-14-2014 (created)
    macroplanmdsid := MDSID::Create( scenario.DatasetMDSID() );
    datasetname := ScenarioManager::GetUniqueCompanyDatasetName( ScenarioManager::ScenarioMP() )
    
    params   := MDSParameters::Create();
    params.State( scenario.State() );
    editor := MDSEditor::Editor();
    editor.CopyMDS( macroplanmdsid, datasetname, params )
    
    //in order to find the newly copied dataset
    //Kernel::Kernel().PropagateAll();
    //Transaction::Transaction().Propagate();
    //Transaction::Transaction().PropagateAll();
    
    Kernel::Kernel().Sleep( 500 );
    
    
    return datasetname;
  *]
}