| Quintiq file version 2.0 | 
| #parent: #root | 
| StaticMethod CanEditActuals ( | 
|   UnitPeriods unitperiods, | 
|   PeriodSpecification_MP periodspecForActual, | 
|   Boolean iseditfrommatrix, | 
|   output String feedback_o | 
| ) declarative remote as Boolean | 
| { | 
|   Description: 'Return true if the selected unit periods is having same type (Quantity/Time).' | 
|   TextBody: | 
|   [* | 
|     feedback_o := ''; | 
|      | 
|     if( not UnitPeriod::IsInPeriodSpecification( unitperiods, periodspecForActual ) ) | 
|     { | 
|       feedback_o := Translations::MP_UnitPeriod_CanEditActuals_IsNotOnPeriodSpecificationForActuals(); | 
|     } | 
|     else if( not iseditfrommatrix ) | 
|     { | 
|       /* Using selectuniquevalues instead of forallexitst | 
|          Because, when all the selection is transport/quantity, we still want to return true */ | 
|       value := selectuniquevalues( unitperiods, Elements.Unit, u, true, u.HasCapacityTypeTimeBase() ); | 
|      | 
|       if( value.Size() <> 1 ) | 
|       { | 
|         feedback_o := Translations::MP_UnitPeriod_CanEditActuals_IsDifferentSubclass(); | 
|       } | 
|     } | 
|      | 
|     return feedback_o = ''; | 
|   *] | 
| } |