| Quintiq file version 2.0 | 
| #parent: #root | 
| StaticMethod CanEditValuesFromMatrix ( | 
|   Strings attributenames, | 
|   output String feedback_o, | 
|   output Boolean isSupply_o, | 
|   output Boolean isActInvent_o | 
| ) as Boolean | 
| { | 
|   Description: 'Returns true if these attributes can be edited via the matrix' | 
|   TextBody: | 
|   [* | 
|     feedback_o := '';                      | 
|      | 
|     // These are the editable attributes | 
|     supplyQty := attribute( ProductInStockingPointInPeriod, SupplyQuantity ).Name(); | 
|     actualInvEnd := attribute( ProductInStockingPointInPeriod, ActualInventoryLevelEnd ).Name(); | 
|      | 
|     uniqueattributes := attributenames.Unique(); | 
|      | 
|     // Check if the selected attribute(s) in the matrix is one of the editable attributes | 
|     isvalid := forall( uniqueattributes,  | 
|                        Elements,  | 
|                        e,  | 
|                        e = supplyQty  | 
|                        or e = actualInvEnd ); | 
|     if( not isvalid ) | 
|     { | 
|       feedback_o := Translations::MP_ProductInStockingPointInPeriod_CanEditValuesFromMatrix(); | 
|     } | 
|     // Check if the user is trying to edit more than one attribute in the matrix | 
|     else if( uniqueattributes.Size() > 1 ) | 
|     { | 
|       feedback_o := Translations::MP_ProductInStockingPointInPeriod_CanOnlyEditOneAttribute(); | 
|     } | 
|     else | 
|     { | 
|       // Check if the selected attribute in the matrix is of SupplyQuantity or ActualInventoryLevelEnd | 
|       isSupply_o := uniqueattributes.Element( 0 ) = supplyQty; | 
|       isActInvent_o := uniqueattributes.Element( 0 ) = actualInvEnd; | 
|     } | 
|      | 
|     return feedback_o = ''; | 
|   *] | 
| } |