Quintiq file version 2.0
|
#parent: #root
|
StaticMethod ValidateInput (
|
output String feedback_o,
|
output String sanitycheckfeedback_o,
|
Operation owner,
|
OperationInputSet operationinputset,
|
String name,
|
Real minquantity,
|
Real maxquantity
|
) declarative remote as Boolean
|
{
|
Description: 'Validate input, triggered when user creates operation input set or edits it.'
|
TextBody:
|
[*
|
feedback_o := '';
|
sanitycheckfeedback_o := '';
|
|
// Check if name is unique
|
if( exists( owner, OperationInputSet, ois,
|
ois <> operationinputset,
|
ois.Name() = name ) )
|
{
|
feedback_o := Translations::MP_OperationInputSet_ValidateInput_IsNotUnique();
|
sanitycheckfeedback_o := SanityCheckCategoryLevel::GetSanityCheckCategoryDataWarning();
|
}
|
// Check if minquantity is valid
|
else if( minquantity < 0 )
|
{
|
feedback_o := Translations::MP_OperationInputSet_Validate_IsNegativeMinQuantity( minquantity );
|
sanitycheckfeedback_o := SanityCheckCategoryLevel::GetSanityCheckCategoryDataWarning();
|
}
|
// Check if minquantity and maxquantity combination is valid
|
else if( maxquantity < minquantity )
|
{
|
feedback_o := Translations::MP_OperationInputSet_ValidateInput_IsMaxQtyLessThanMinQty( maxquantity, minquantity );
|
sanitycheckfeedback_o := SanityCheckCategoryLevel::GetSanityCheckCategoryDataWarning();
|
}
|
|
// Add feedback text if any of the precondition above is violated
|
if( feedback_o <> '' )
|
{
|
instance := Translations::MP_OperationInputSet_Instance( name, owner.Name() );
|
feedback_o := SanityCheckMessage::GetFormattedMessage( instance, feedback_o );
|
}
|
|
return feedback_o = '';
|
*]
|
}
|