Quintiq file version 2.0
#parent: #root
Method SetNavigationToRoot () id:Method_ApplicationLibMacroPlanner_SetNavigationToRoot
{
  #keys: '[127238.0.1892234081]'
  Body:
  [*
    // reset to root
    // Select stocking points that does not belong to any unit
    stockingpoints := selectset( MacroPlan, StockingPoint_MP, sp, isnull( sp.Unit() ) and not sp.IsSystem() );
    units := selectset( MacroPlan, RootUnit, unit, true );
    products := selectset( MacroPlan, RootProduct, product, not product.IsSystem() );
    salessegments := selectset( MacroPlan, RootSalesSegment, sales, true );
    periods := selectset( MacroPlan, PeriodSpecification_MP, ps, ps.IsDummyPlanningPeriod() );
    
    DataHolderUnits.Data( units.Copy() )
    DataHolderStockingPoints.Data( &stockingpoints ) // workaround to clear SP dataholder
    DataHolderProducts.Data( products.Copy()) 
    DataHolderSalesSegments.Data( salessegments.Copy() );
    DataHolderShowChildOfUnit.Data( units.Copy() );
    DataHolderPeriodObjects.Data( periods.Copy() );
  *]
}
