Quintiq file version 2.0
|
#parent: #root
|
StaticMethod ValidateInput (
|
output String feedback_o,
|
output String sanitycheckfeedback_o,
|
Boolean checkunique,
|
PostponementSpecification postponementspecification,
|
SalesSegment_MP targetsalessegment,
|
String horizontimeunit,
|
Number horizonnroftimeunit,
|
String maxtimeunit,
|
Number maxnroftimeunit
|
) declarative remote as Boolean
|
{
|
Description: 'Check for input obtained from UI'
|
TextBody:
|
[*
|
feedback_o := '';
|
sanitycheckfeedback_o := '';
|
|
// Is unique
|
if( checkunique
|
and ( not isnull( targetsalessegment )
|
and not isnull( targetsalessegment.PostponementSpecification() )
|
// For when Editing the PS. New and Copy have postponementspecification = null
|
and targetsalessegment.PostponementSpecification() <> postponementspecification ) )
|
{
|
feedback_o := Translations::MP_PostponementSpecification_ValidateInput_SalesSegment( targetsalessegment.Name() );
|
sanitycheckfeedback_o := SanityCheckCategoryLevel::GetSanityCheckCategoryDataIssue();
|
}
|
// Check if horizon time unit is valid
|
else if( not PeriodSpecification_MP::GetHasValidTimeUnit( horizontimeunit ) )
|
{
|
feedback_o := Translations::MP_PeriodSpecification_MP_ValidateInput_InvalidTimeUnit();
|
sanitycheckfeedback_o := SanityCheckCategoryLevel::GetSanityCheckCategoryDataIssue();
|
}
|
// Check if the number of horizon time unit is valid
|
else if( horizonnroftimeunit <= 0 )
|
{
|
feedback_o := Translations::MP_PostponementSpecification_ValidateInput_PostponementHorizon( horizonnroftimeunit, horizontimeunit );
|
sanitycheckfeedback_o := SanityCheckCategoryLevel::GetSanityCheckCategoryDataIssue();
|
}
|
// Check if max time unit is valid
|
else if( not PeriodSpecification_MP::GetHasValidTimeUnit( maxtimeunit ) )
|
{
|
feedback_o := Translations::MP_PeriodSpecification_MP_ValidateInput_InvalidTimeUnit();
|
sanitycheckfeedback_o := SanityCheckCategoryLevel::GetSanityCheckCategoryDataIssue();
|
}
|
// Check if the number of max time unit is valid
|
else if( maxnroftimeunit <= 0 )
|
{
|
feedback_o := Translations::MP_PostponemenSpecification_ValidateInput_MaximumPostponement( maxnroftimeunit, maxtimeunit );
|
sanitycheckfeedback_o := SanityCheckCategoryLevel::GetSanityCheckCategoryDataIssue();
|
}
|
|
return feedback_o = '';
|
*]
|
}
|