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