Quintiq file version 2.0
#parent: pnlActions/btnOk
Response OnClick () id:Response_pnlActions_btnOk_OnClick
{
  #keys: '[414382.0.465983531]'
  DefinitionID: 'Responsedef_WebButton_OnClick'
  Precondition:
  [*
    checkValue := true;
    if( PriorityFactorName.Text() = ''){
      feedback := Translations::PriorityFactor_CheckNameNull();
      checkValue := false;
    }
    return checkValue
  *]
  QuillAction
  {
    Body:
    [*
      businessType := DataHolderBusinessTyoeSelect.Data( );
      if( NewFlag.Checked() ){
       // New
        repeatOne := select( businessType,PriorityFactor,pf,pf.Name() = PriorityFactorName.Text());
        if( not isnull( repeatOne )){
          WebMessageBox::Error( Translations::PriorityFactor_CheckNameValid() ); 
        }else{
          Form.ClickBtnOK();
        }
      }else {
              if (EditFlag.Checked() and PriorityFactorNameCache.Text() <>PriorityFactorName.Text()){
                  // Edit
                  repeatOne:=select(businessType, PriorityFactor, pf, pf.Name() = PriorityFactorName.Text());
                  if (not isnull(repeatOne)){
                      WebMessageBox::Error (Translations::PriorityFactor_CheckNameValid () );
                  }else{
                      Form.ClickBtnOK();
                  }
              }else{
                  Form.ClickBtnOK();
              }
      }
    *]
    GroupServerCalls: false
  }
}
