Quintiq file version 2.0
#parent: #root
Method CanOpenWizard (
  Boolean checkMacroplan,
  output String feedback
) as Boolean id:Method_ApplicationLibMacroPlanner_CanOpenWizard
{
  #keys: '[134490.0.379525199]'
  Body:
  [*
    // Verify whether MacroPlan is selected and no wizard is open
    
    canOpen := not checkMacroplan or MacroPlan::HasMacroPlan( MacroPlan, feedback );
    
    if( canOpen )
    {
      dlg := Application.Frame().FindChildObject( typeof( LibWiz_DialogInitProcess ).Name() ).astype( LibWiz_DialogInitProcess );
      if( not isnull( dlg ) )
      {
        canOpen := false;
        feedback := Translations::MP_Designer_MenuWizard_CanOpenWizard();
      }
    }
    
    return canOpen;
  *]
}
