Quintiq file version 2.0
#parent: #root
Method PopulatePeriods () id:Method_BaseFormExternalSupplies_PopulatePeriods
{
  #keys: '[136682.2.163501870]'
  Body:
  [*
    
    periods:= DataHolderExternalSupplyNavPeriods.Data();
    
    if ( periods.Size() >0 )
    {
      periods.Sort( attribute( Period_MP, Start) , true );
      start := periods.First().Start();
      end := periods.Last().End();
      overlaps := selectset(  MacroPlan, Period_MP, period, period.IsInPeriod( start, end ) );
      
      DataHolderOverlapPeriods.Data( overlaps.Copy() );
    }
    else
    {
      DataHolderOverlapPeriods.Data().Flush();  
    }
  *]
}
