| Quintiq file version 2.0 | 
| #parent: Toolbar746/btnOk | 
| Response OnClick () id:Response_Toolbar746_btnOk_OnClick | 
| { | 
|   #keys: '[130036.1.306632896]' | 
|   Body: | 
|   [* | 
|     // Apply changes | 
|     stucData := construct( PostponementSpecifications ); | 
|     stucData.Add( Dialog.Data().WrappedInstance() );        | 
|      | 
|     hasChangedSalesSegment := guard( SelectionSalesSegment.Data() <> Dialog.Data().SalesSegment_MP(),  | 
|                               false ); // Guard false for handling New and Copy  | 
|      | 
|      | 
|     // Doing the dialog prompt here instead of in Edit method because we want the dialog to promt before EndModal | 
|     if( not hasChangedSalesSegment // If not changing sales segment, skip dialog prompt | 
|         or ( hasChangedSalesSegment // If chaging sales segment, prompt dialog  | 
|              and ApplicationLibMacroPlanner.GetConfirmation_DeletePostponementSpecification( Dialog, stucData ) ) ) | 
|     {    | 
|       Dialog.ApplyChanges(); | 
|       Dialog.EndModal(1); | 
|     } | 
|   *] | 
|   DefinitionID: 'Responsedef_GUIButtonBase_OnClick' | 
|   Precondition: | 
|   [* | 
|     feedback := '';                                  | 
|     sanitycheckfeedback := ''; | 
|     return PostponementSpecification::ValidateInput( feedback, | 
|                                                      sanitycheckfeedback, | 
|                                                      true, | 
|                                                      Dialog.Data().WrappedInstance(), | 
|                                                      SelectionSalesSegment.Data(), | 
|                                                      StringSelectionHorizonTimeUnit.Text(), | 
|                                                      ApplicationLibMacroPlanner.FormatStringToNumber( EditorHorizonNrOfTimeUnit.Text() ), | 
|                                                      StringSelectionMaxTimeUnit.Text(), | 
|                                                      ApplicationLibMacroPlanner.FormatStringToNumber( EditorMaxNrOfTimeUnit.Text() ) ); | 
|   *] | 
| } |