Quintiq file version 2.0
#parent: ListScenario
Response OnClick (
  Scenario selection
) id:Response_ListScenario_MenuScenarioCreateKB_OnClick
{
  #keys: '[11766.1.296328270]'
  Body:
  [*
    // Create a new kb branch
    kbname := ''
    if ( selection.istype( ScenarioMP ) )
    {
      kbname := GlobalParameters_MP::GetKBName();
    }
    
    kb := select( ScenarioManager.MDSScenarioManager(), MDSKBs, kb, kb.Name() = kbname );
    kbfullid := KBFullID::Create( kb.Domain(), kb.Name(), kb.Branch(), kb.Version(), 1 );
    ApplicationLibMacroPlanner.NewKBBranch( kbfullid, selection );
  *]
  CanBindMultiple: false
  DefinitionID => /ListScenario/Responsedef_ListScenario_Menu_OnClick
  Initiator: 'MenuScenarioCreateKB'
  Precondition:
  [*
    return selection.CanModifyKB( feedback );
  *]
}
