Quintiq file version 2.0
|
#parent: #root
|
StaticMethod ValidateInput (
|
output String feedback_o,
|
output String sanitycheckfeedback_o,
|
Product_MP product,
|
StockingPoint_MP stockingpoint,
|
Date start,
|
Real cost,
|
PostponedSalesDemandCost old_postponedsdcost,
|
Boolean checkunique
|
) declarative remote as Boolean
|
{
|
Description: 'Validate input, called from designer'
|
TextBody:
|
[*
|
feedback_o := '';
|
|
// Check if the postponed sales demand cost can be created.
|
// For editing of postponed sales demand, exclude itself from the checking of the primary key.
|
if( checkunique
|
and not PostponedSalesDemandCost::IsPrimaryKeysUnique( product, stockingpoint, start, old_postponedsdcost ) )
|
{
|
feedback_o := Translations::MP_PostponedSalesDemandCost_ValidateInput_IsNotUnique();
|
sanitycheckfeedback_o := SanityCheckCategoryLevel::GetSanityCheckCategoryDataIssue() ;
|
}
|
// Check if cost is valid
|
else if( cost < 0 )
|
{
|
feedback_o := Translations::MP_PostponedSalesDemandCost_ValidateInput_IsNegativeCost( cost );
|
sanitycheckfeedback_o := SanityCheckCategoryLevel::GetSanityCheckCategoryDataIssue() ;
|
}
|
// Check if product is valid
|
else if( isnull( product ) )
|
{
|
feedback_o := Translations::MP_PostponedSalesDemandCost_ValidateInput_IsNullProduct();
|
sanitycheckfeedback_o := SanityCheckCategoryLevel::GetSanityCheckCategoryDataWarning() ;
|
}
|
// Check if stocking point is valid
|
else if( isnull( stockingpoint ) )
|
{
|
feedback_o := Translations::MP_PostponedSalesDemandCost_ValidateInput_IsNullStockingPoint();
|
sanitycheckfeedback_o := SanityCheckCategoryLevel::GetSanityCheckCategoryDataWarning() ;
|
}
|
|
// Add feedback text if there's any precondition above being violated
|
if( feedback_o <> '' )
|
{
|
pispname := MacroPlan::GetSubstituteName( guard( product.Name(), '' ) );
|
feedback_o := SanityCheckMessage::GetFormattedMessage( Translations::MP_PostponedSalesDemandCost_Instance( pispname, start ),
|
feedback_o );
|
}
|
|
return feedback_o = '';
|
*]
|
}
|