| Quintiq file version 2.0 | 
| #parent: #root | 
| StaticMethod ValidateInput ( | 
|   output String feedback_o, | 
|   output String sanitycheckfeedback_o, | 
|   Routing owner, | 
|   RoutingStep routingstep, | 
|   String name, | 
|   Boolean checkuniqueid | 
| ) declarative remote as Boolean | 
| { | 
|   Description: 'Check input is valid' | 
|   TextBody: | 
|   [* | 
|     // Adhi Feb-10-2016 (created) | 
|     maxnamelength := GlobalParameters_MP::GetLengthOfNames(); | 
|     feedback_o := ''; | 
|     sanitycheckfeedback_o := ''; | 
|      | 
|      | 
|     if( checkuniqueid | 
|          and exists( owner, RoutingStep, rs, rs <> routingstep, rs.Name() = name ) ) | 
|     { | 
|       feedback_o := Translations::MP_RoutingStep_ValidateInput_IsNameExists(); | 
|       sanitycheckfeedback_o := SanityCheckCategoryLevel::GetSanityCheckCategoryDataIssue(); | 
|     } | 
|     // Invalid name | 
|     else if( name = '' or name.Length() > maxnamelength ) | 
|     { | 
|       feedback_o := Translations::MP_RoutingStep_ValidateInput_IsInvalidName( maxnamelength ); | 
|       sanitycheckfeedback_o := SanityCheckCategoryLevel::GetSanityCheckCategoryDataWarning(); | 
|     } | 
|     // Operations LeadTime should be the same for all operations | 
|     else if(  not isnull( routingstep ) and not routingstep.IsLeadTimeAmongOperationsUnique() ) | 
|     { | 
|       feedback_o := Translations::MP_RoutingStep_ValidateInput_IsLeadTimeNotUnique(); | 
|       sanitycheckfeedback_o := SanityCheckCategoryLevel::GetSanityCheckCategoryDataWarning();  | 
|     } | 
|      | 
|      | 
|     // Add instance text | 
|     if( feedback_o <> '' ) | 
|     { | 
|       rsname := MacroPlan::GetSubstituteName( name ); | 
|       instance := Translations::MP_RoutingStep_Instance( rsname, owner.Name() ); | 
|       feedback_o := SanityCheckMessage::GetFormattedMessage( instance, | 
|                                                              feedback_o ); | 
|     } | 
|      | 
|     return feedback_o = ''; | 
|   *] | 
| } |