Quintiq file version 2.0
#parent: #root
Method HasValidDataset (
  Scenario scenario
) as String id:Method_ApplicationMacroPlanner_HasValidDataset
{
  #keys: '[139394.0.747746258]'
  Body:
  [*
    // Check if a scenario has a valid dataset
    
    feedback := '';
    if( isnull( scenario ) )
    {
      feedback := Translations::MP_MacroPlan_HasCompany();
    }
    else if( not exists( ExternalMDSEditor::Editor().ObjectInfos(),
                         Elements,
                         e,
                         e.MDSID().MDSKey() = scenario.DatasetMDSID() ) )
    {
      feedback := Translations::ScenarioManager_InvalidScenarioDataset( scenario.Name() );
    }
    
    return feedback;
  *]
}
