Quintiq file version 2.0 #parent: #root Method InstantiateAndSelectKB ( Scenario scenario ) id:Method_DialogCreateEditScenario_InstantiateAndSelectKB { #keys: '[134266.1.2021821195]' Body: [* //Instantiate knowledge /* Domain.PublishKnowledge(); editor := CKBEditor::Create(); kbfullid := maxselect ( DataHolderKB.Data(), Elements.KBFullID, k, k.Name().ToUpper() = ScenarioManager.CompanyKBName().ToUpper(), k.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( edtBranch.Text() ); //Perform the actual saveAs action editor.SaveKBAs( modelkb, modelkb.CKB().ID(), ''); saveid.ChangeNr( 1 ); //Select the new KB for the MDS ApplicationMacroPlanner.SelectKB( scenario, saveid ); return saveid; *] }