Quintiq file version 2.0
#parent: splitMain/btnAddKpiValue
Response OnClick () id:Response_splitMain_btnAddKpiValue_OnClick
{
  #keys: '[136398.1.387357216]'
  Body:
  [*
    name  := txtKpiName.Text().TrimBoth();
    value := txtKpiValue.Text().TrimBoth();
    dhSnapshot.Data().Value( relnew, Name := name, Value := StringToReal::UserConverter().Convert( value ) );
  *]
  CanBindMultiple: false
  DefinitionID: 'Responsedef_GUIButtonBase_OnClick'
  Precondition:
  [*
    FeedbackObject::AddHard( not isnull( dhSnapshotSet.Data() ), "Please make sure you have a KpiSnapshotSetData dataset selected." );
    FeedbackObject::AddHard( txtKpiName.Text().TrimBoth() <> "", "Please fill in a KPI name." );
    FeedbackObject::AddHard( txtKpiValue.Text().TrimBoth() <> "", "Please fill in a KPI value." );
    FeedbackObject::AddHard( StringToReal::UserConverter().CanConvert( txtKpiValue.Text().TrimBoth() ), "Please fill in a real for the KPI value." );
    return FeedbackObject::IsAllowed();
  *]
}
