| Quintiq file version 2.0 | 
| #parent: PanelActions/ButtonApply_593 | 
| Response OnClick () id:Response_PanelActions_144_ButtonApply_OnClick_715 | 
| { | 
|   #keys: '[144528.1.1787513586]' | 
|   CanBindMultiple: false | 
|   DefinitionID: 'Responsedef_WebButton_OnClick' | 
|   Precondition: | 
|   [* | 
|     sanitycheckfeedback := ''; | 
|     gp := guard( MacroPlan.GlobalParameters_MP(), null( GlobalParameters_MP ) ); | 
|     formHasChanges := ApplicationMacroPlanner.CheckFormHasChangesWithFeedback( FormKPIHorizonSettings, 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(), | 
|                                                    DateSelectorStartHorizon.Date(), | 
|                                                    DateSelectorEndHorizon.Date(), | 
|                                                    gp.DefaultSmartPlanStrategy(), | 
|                                                    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(), | 
|                                                    gp.NoiseThresholdOptimizerOutput(), | 
|                                                    gp.NumberOfPeriodsSmartPlan(), | 
|                                                    gp.UseSlidingWindowsApproach(), | 
|                                                    gp.NumberOfPeriodsInWindow(), | 
|                                                    gp.NumberOfPeriodsPerSlide(), | 
|                                                    gp.DefaultServiceLevel(), | 
|                                                    gp.StockingPointBottleneckThreshold()); | 
|   *] | 
|   QuillAction | 
|   { | 
|     Body: | 
|     [* | 
|       // Apply | 
|       Form.ApplyChanges(); | 
|        | 
|       // Changes in KPI horizon, to recalculate KPIs in KPI matrix | 
|       MacroPlan.CalculateKPIScore( false ); | 
|     *] | 
|     GroupServerCalls: false | 
|   } | 
| } |