Quintiq file version 2.0
#parent: PanelActions/ButtonApply
Response OnClick () id:Response_PanelActions_ButtonApply_OnClick
{
  #keys: '[144528.1.1837238913]'
  CanBindMultiple: false
  DefinitionID: 'Responsedef_WebButton_OnClick'
  Precondition:
  [*
    sanitycheckfeedback := '';
    gp := guard( MacroPlan.GlobalParameters_MP(), null( GlobalParameters_MP ) );
    formHasChanges := ApplicationMacroPlanner.CheckFormHasChangesWithFeedback( FormOptimizerSettings, feedback );
    
    return not isnull( MacroPlan )
           and formHasChanges 
           and GlobalParameters_MP::ValidateInput( feedback,
                                                   sanitycheckfeedback,
                                                   MacroPlan,
                                                   MacroPlan.DefaultShiftPattern(),
                                                   gp.DisaggregationRatio(),
                                                   gp.NumberOfDecimals(),
                                                   gp.BalanceTolerance(),
                                                   gp.LotSizeTolerance(),
                                                   gp.BottleneckTolerance(),
                                                   gp.BottleneckWindowStart(),
                                                   gp.BottleneckWindowEnd(),
                                                   gp.StartOfKPIHorizon(),
                                                   gp.EndOfKPIHorizon(),
                                                   DropDownStringListDefaulSmartPlanStrategy.Text(),
                                                   gp.UnitLowerBottleneckThreshold(),
                                                   gp.UnitUpperBottleneckThreshold(),
                                                   gp.SanityCheckLimit(),
                                                   gp.AbsoluteUpperLimit(),
                                                   gp.AbsoluteLowerLimit(),
                                                   gp.DefaultAllocation(),
                                                   gp.DefaultEfficiency(),
                                                   gp.DefaultMinCapacityPerDayForUnit(),
                                                   gp.DefaultMaxCapacityPerDayForUnit(),
                                                   gp.DefaultMaxLoadPercentage(),
                                                   gp.DefaultMaxCapacityForStockingPoint(),
                                                   gp.DefaultOperationInputOutputQuantity(),
                                                   gp.HasDefaultInventoryHoldingCost(),
                                                   gp.DefaultAccountForInventoryHolding(),
                                                   gp.HasAbsoluteValueForInventoryHolding(),
                                                   gp.DefaultAbsoluteValueForInventoryHolding(),
                                                   gp.DefaultAnnualInterestRateForInventoryHolding(),
                                                   gp.PeriodSpecificationForUnitActual(),
                                                   gp.DefaultNumberOfPeriodsForAvgDemand(),
                                                   ApplicationMacroPlanner.FormatStringToReal( EditFieldOutputNoiseTreshold.Text() ),
                                                   gp.NumberOfPeriodsSmartPlan(),
                                                   gp.UseSlidingWindowsApproach(),
                                                   gp.NumberOfPeriodsInWindow(),
                                                   gp.NumberOfPeriodsPerSlide(),
                                                   gp.DefaultServiceLevel(),
                                                   gp.StockingPointBottleneckThreshold());
  *]
  QuillAction
  {
    Body:
    [*
      // Apply
      Form.ApplyChanges();
    *]
    GroupServerCalls: false
  }
}
