admin
2025-01-22 7e31442f0e9b07764e9c6a9680d3d4aeba5fe1de
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
Quintiq file version 2.0
#parent: #root
Method GetHasValidTimeUnit (
  output Strings feedback_o,
  output Strings sanitycheckfb
) declarative remote as Boolean
{
  Description: 'Returns true if time unit matches one of the time units supported in MP'
  TextBody:
  [*
    // desmondt May-06-2015 (created)                           
    isavlid := PeriodSpecification_MP::GetHasValidTimeUnit( this.TimeUnit() );
    
    if( not isnull( feedback_o ) and not isavlid )
    {
      unitname := MacroPlan::GetSubstituteName( this.Unit().Name() );
      feedback_o.Add( SanityCheckMessage::GetFormattedMessage( Translations::MP_TransportAvailability_Instance( unitname, this.Start() ),
                                                               Translations::MP_PeriodSpecification_MP_ValidateInput_InvalidTimeUnit() ) );
      sanitycheckfb.Add( SanityCheckCategoryLevel::GetSanityCheckCategoryDataIssue() );                                                           
    }
    
    return isavlid;
  *]
}