Quintiq file version 2.0
#parent: #root
Method GetActivatedFormSuboptimizerScopeElement () as LibOpt_FormSuboptimizerScopeElement id:Method_LibOpt_GlobalState_GetActivatedFormSuboptimizerScopeElement
{
  #keys: '[151132.0.11778828]'
  Body:
  [*
    // Get an activated LibOpt_FormSuboptimizerScopeElement instance.
    
    formsuboptimizerscopeelement := select( Application.Frame(), SubComponents.astype( LibOpt_FormSuboptimizerScopeElement ), form, true );
    
    // Construct the form if it doesn't exist yet.
    if( isnull( formsuboptimizerscopeelement ) )
    {
      formsuboptimizerscopeelement := construct( LibOpt_FormSuboptimizerScopeElement );
      Application.Frame().ShowForm( &formsuboptimizerscopeelement );
    }
    
    // Set focus on the form.
    formsuboptimizerscopeelement.Activate();
    
    // Clear the current selections in the list.
    listsuboptimizerscopeelement := formsuboptimizerscopeelement.ListSuboptimizerScopeElement();
    listsuboptimizerscopeelement.SelectByKey( Key::ZeroKey() );
    
    return formsuboptimizerscopeelement;
  *]
}
