Quintiq file version 2.0
#parent: SplitterWnd1/ButtonAssignAll
Response OnClick (
  structured[shadow[KPIWeight]] selection
) id:Response_SplitterWnd1_ButtonAssignAll_OnClick
{
  #keys: '[112884.0.670603440]'
  Body:
  [*
    // Activate all kpi weights as goal
    maxlevel := max( DataHolderActiveKPIs.Data(), Elements, weight, weight.Level() );
    kpiweights := selectset( Dialog.Data(), KPIWeight, kpi, kpi.Level() = 0 and kpi.KPI().IsUsedByOptimizer() );
    
    Dialog.ActivateKPIWeight( kpiweights, ifexpr( maxlevel < 1, 1, maxlevel ) );
  *]
  CanBindMultiple: false
  DefinitionID => /SplitterWnd1/Responsedef_SplitterWnd1_ButtonUnassign1_OnClick
  UserRequiresReadWrite: true
}
