| Quintiq file version 2.0 | 
| #parent: #root | 
| StaticMethod DataValidation (LibDMF_SystemOnChannel owner_i, String name_i, String group_i,  | 
|   LibDMF_SetType existingSetType_i, output Strings feedbacks_o) declarative remote as Boolean | 
| { | 
|   Description: 'Method to validate input from UI' | 
|   TextBody: | 
|   [* | 
|     // Timothy Guan 30-Jun-2015 (Created) | 
|     // Mind: This implementation assumes that owner is NEVER null | 
|      | 
|     value := true; | 
|     ccr := owner_i.GetCommunicationChannelRoot(); | 
|      | 
|     //Name shouldn't be empty | 
|     if( name_i = '' ) | 
|     { | 
|       value := LibDMF_Util::CollectFeedback( ccr.GetTranslation( 'DM_SetType_DataValidation_IsNameEmpty' ), | 
|                                              feedbacks_o ); | 
|     } | 
|      | 
|     //Group shouldn't be empty | 
|     if( group_i = '' ) | 
|     { | 
|       value := LibDMF_Util::CollectFeedback( ccr.GetTranslation( 'DM_SetType_DataValidation_IsGroupEmpty' ), | 
|                                                                      feedbacks_o ); | 
|     } | 
|      | 
|     //Check for unique name (Across all channels) | 
|     setType := select( ccr, CommunicationChannel.SystemOnChannel.SetType, setType, | 
|                        setType <> existingSetType_i, | 
|                        setType.Name() = name_i ); | 
|      | 
|     if( not isnull( setType ) ) | 
|     { | 
|       channelName := setType.SystemOnChannel().ChannelName(); | 
|      | 
|       value := LibDMF_Util::CollectFeedback( ccr.GetTranslation( 'DM_SetType_DataValidation_IsNameExists', channelName ), | 
|                                              feedbacks_o ); | 
|     } | 
|      | 
|     return value; | 
|   *] | 
| } |