Quintiq file version 2.0 
 | 
#parent: #root 
 | 
StaticMethod ValidateInput ( 
 | 
  output String feedback_o, 
 | 
  MacroPlan macroplan, 
 | 
  String priorityname, 
 | 
  Priority priority, 
 | 
  Boolean checkunique, 
 | 
  output String sanitycheckfb 
 | 
) declarative remote as Boolean 
 | 
{ 
 | 
  Description: 'Check if creation of priority is allowed. Called by designer' 
 | 
  TextBody: 
 | 
  [* 
 | 
       feedback_o := ''; 
 | 
        
 | 
       namelengthlimit := GlobalParameters_MP::GetLengthOfNames(); 
 | 
       name := MacroPlan::GetSubstituteName( priorityname ); 
 | 
        
 | 
       instance := Translations::MP_Priority_Instance( name ); 
 | 
        
 | 
    if( checkunique 
 | 
                and exists( macroplan, Priority, p, p <> priority, p.Name() = priorityname ) ) 
 | 
       { 
 | 
         feedback_o := SanityCheckMessage::GetFormattedMessage( instance, 
 | 
                                                                Translations::MP_Priority_ValidateInput_IsNameExists() ); 
 | 
         sanitycheckfb := SanityCheckCategoryLevel::GetSanityCheckCategoryDataIssue() ;                                                          
 | 
       } 
 | 
        
 | 
       else if( priorityname = '' or priorityname.Length() > namelengthlimit ) 
 | 
       { 
 | 
         feedback_o := SanityCheckMessage::GetFormattedMessage( instance, 
 | 
                                                                Translations::MP_Priority_ValidateInput_IsNameEmptyAndExceedLengthLimit( namelengthlimit ) ); 
 | 
         sanitycheckfb := SanityCheckCategoryLevel::GetSanityCheckCategoryDataWarning() ;                                                          
 | 
       } 
 | 
        
 | 
       return feedback_o = ''; 
 | 
  *] 
 | 
} 
 |