Quintiq file version 2.0
#parent: LibSOPImpExp_ContextMenuExport/MenuExportFromSCIExtend
Response OnClick () inherited id:Response_MacroPlanner_LibSOPImpExp_ContextMenuExport_MenuExportFromSCIExtend_OnClick
{
  #keys: '[146140.3.52476396]'
  BaseType: 'Response_MenuExportFromSCI_OnClick'
  DefinitionID: 'Responsedef_WebMenu_OnClick'
  Precondition:
  [*
    return MacroPlan::HasMacroPlan( MacroPlan, feedback );
  *]
  QuillAction
  {
    Body:
    [*
      // Synchronize LibSCIScenarios with ScenarioMP then open the dialog
      // Create 2 lists of Strings to stock Names and DatasetNames
      scenarionames := construct( Strings );
      scenariodatasetnames := construct( Strings );
      assumptions := construct( Strings );
      
      // Traverse non IsDeleted Scenario_MP in order to get names and datasetname
      // These values are needed for the synchronization
      traverse( ScenarioManager, ScenarioMP, scenario, not scenario.IsDeleted() )
      {
        scenarionames.Add( scenario.Name() );
        scenariodatasetnames.Add( scenario.DatasetName() );
        concatenatedassumption := selectuniquevalues( scenario, Assumption, assmption, assmption.ID() ).ToString( LibSCIIntegration_Utility::Delimiter() )
        // Add empty space if no assumption for the Scenario, so that number of elements tally with Scenario
        assumptions.Add( ifexpr( concatenatedassumption.Length() >0, concatenatedassumption, " " ) );
      }
      
      // Synchronize LibSCIScenario with Scenario_MP
      LibSCIIntegrationInterface.SynchronizeLibSCIScenarioWithScenarioMP( scenariodatasetnames, scenarionames, assumptions );
      
      dlg := construct( DialogSCIExportReports );
      dlg.Initialize();
    *]
    GroupServerCalls: false
  }
}
