Quintiq file version 2.0
#parent: MenuCreateDefaultKB
Response OnClick () id:Response_FormKBManagement_MenuCreateDefaultKB_OnClick
{
  #keys: '[101320.0.110724530]'
  Body:
  [*
    editor := CKBEditor::Create();
    kb := select( MacroPlan.MDSMacroPlan(), MDSKBs, kb, kb.Name().ToUpper() = ScenarioManager.CompanyKBName().ToUpper() );
    kbfullid := KBFullID::Create( kb.Domain(), kb.Name(), kb.Branch(), kb.Version(), kb.ChangeNr() );
    ids := editor.GetKBs();
    mid := selectobject (ids, Elements, e, e.Domain() = kbfullid.Domain() and e.Name() = kbfullid.Name(), true)
    modelkb := editor.GetModelKB( mid );
    
    //get a copy so we could edit
    saveid := modelkb.CKB().ID();
    saveid.Version( "1.0.0.0" );
    saveid.Branch( GlobalParameters_MP::GetKB() );
    description := 'KB1';
    
    //Perform the actual saveAs action
    editor.SaveKBAs( modelkb, modelkb.CKB().ID(), description);
    saveid.ChangeNr( 1 );
  *]
  CanBindMultiple: false
  DefinitionID: 'Responsedef_Menu_OnClick'
  UserRequiresReadWrite: true
}
