Quintiq file version 2.0
#parent: #root
Method SelectUnits (
  structured[Unit] units
) id:Method_DialogSelectUnitsForSmartPlan_SelectUnits
{
  #keys: '[136682.0.1870162028]'
  Body:
  [*
    //Select units
    
    //Get children
    children := selectset( units, Elements.AllChildren.AsChildren, c, true );
    
    //Remove from unselected
    currentUnselected := DataHolderUnselectedUnitsSPD.Data();
    remove := currentUnselected.Difference( children );
    DataHolderUnselectedUnitsSPD.Data( &remove );
    
    //Add to selected
    currentUnits := DataHolderSelectedUnitsSPD.Data();
    alltogether := children.Union( currentUnits );
    DataHolderSelectedUnitsSPD.Data( &alltogether );
  *]
}
