Quintiq file version 2.0
#parent: #root
Method GetKB (
  Scenario scenario
) as MDSObjectKB id:Method_ApplicationLibMacroPlanner_GetKB
{
  #keys: '[11660.0.94607789]'
  Body:
  [*
    // Get KB
    componentmds := ComponentMDS::CreateForLoadedMDSsOnly( Application );
    mdsinstance := selectobject( componentmds, ComponentMDSKinds.ComponentMDSInstances, m, m.MDSID().Equals( scenario.DatasetMDSID() ) );
    kb := select( mdsinstance.GetMDSHandle().AsMacroPlan().MDSMacroPlan(), MDSKBs, kb, kb.Name().ToUpper() = ScenarioManager.CompanyKBName().ToUpper() );
    
    return kb;
  *]
}
