Quintiq file version 2.0
#parent: Toolbar/btnOk
Response OnClick () id:Response_Toolbar_btnOk_OnClick
{
  #keys: '[11660.0.301402219]'
  Body:
  [*
    Dialog.EndModal(1);
  *]
  DefinitionID: 'Responsedef_GUIButtonBase_OnClick'
  Precondition:
  [*
    nr := guard ( [Number] EditorNr.Text(), Number::MinNumber() );
    if ( nr < 0 )
    {
      feedback := 'Please enter a valid number';
    }
    else if ( nr = 0 )
    {
      strings := LabelSelectedKB.Text().Tokenize( ':' );
      if ( strings.Size() = 4 )
      {
        name := strings.Element( 0 );
        branch := strings.Element( 1 );
    
        if (name =ScenarioManager.CompanyKBName() and branch = GlobalParameters_MP::GetKB() )
        {
          feedback := 'You need to keep at least 1 default knowledgebase instance, name=' + ScenarioManager.CompanyKBName() + ', branch=KB'
        }
      }
    }
    return feedback = '';
  *]
}
