Kevin Kok Khah Whey
2023-11-07 5ae534ab606e6f2ba5ea60914224d665b0447d5a
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
Quintiq file version 2.0
#parent: #root
StaticMethod ValidateInput (
  output String feedback_o,
  output String sanitycheckfeedback_o,
  Real defaultquantity,
  OperationInputOutput operationio
) declarative remote as Boolean
{
  Description: 'Validate input for factor'
  TextBody:
  [*
    if( defaultquantity <= 0 )
    {
      feedback_o := Translations::MP_OperationInputOutput_ViolateHasValidQuantity( defaultquantity );
      sanitycheckfeedback_o := SanityCheckCategoryLevel::GetSanityCheckCategoryDataIssue();
    }
    
    else if( isnull( operationio.PISPNodeInRouting() ) and operationio.OperationBOM( relsize ) >0 )
    {
      operationbom := operationio.OperationBOM();
      if( not operationbom.HasValidProduct() )
      {
        feedback_o := Translations::MP_OperationInputOutput_ProductNotExists( operationio.ProductID() );
        sanitycheckfeedback_o := SanityCheckCategoryLevel::GetSanityCheckCategoryDataIssue();
      }
    }         
    
    
    if( feedback_o <> '' )
    {
      instance := OperationInputOutput::GetInstanceText( operationio );
      feedback_o := SanityCheckMessage::GetFormattedMessage( instance, feedback_o );
    }
    
    return feedback_o = '';
  *]
}