Quintiq file version 2.0
#parent: pnlActions/btnOK
Response OnClick () id:Response_pnlActions_btnOk_OnClick
{
  #keys: '[136682.1.2137917103]'
  DefinitionID: 'Responsedef_WebButton_OnClick'
  Precondition:
  [*
    feedback :="";
    sanitycheckfeedback :="";
    
    hassafetystockdays := cbOverrideCalculatedSafetyStock.Checked() and [Boolean]rbgSafetyStock.BoundValue();
    
    return not isnull( DataHolderDialogData.Data() ) and  
          SafetyStock::ValidateInput( feedback, sanitycheckfeedback, 
                                      guard( ddlProduct.Data(), null( Product_MP ) ),
                                      guard( ddlStockingPoint.Data(), null( StockingPoint_MP ) ),
                                      dsStart.Date(),
                                      hassafetystockdays,
                                      ifexpr( hassafetystockdays, ApplicationMacroPlanner.FormatStringToReal( efSafetyStockInDays.Text(),0.0 ), 0.0 ),
                                      ifexpr( not hassafetystockdays, ApplicationMacroPlanner.FormatStringToReal( efSafetyStockInQuantity.Text(), 0.0 ), 0.0 ),
                                      guard( DataHolderDialogData.Data().WrappedInstance(), null( SafetyStock ) ),
                                      true );
  *]
  QuillAction
  {
    Body:
    [*
      Form.OnOK();
    *]
    GroupServerCalls: false
  }
}
