1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
  | Quintiq file version 2.0 
 |  #parent: #root 
 |  StaticMethod CanCreate ( 
 |    Trip trip, 
 |    Product_MP product, 
 |    output String feedback_o 
 |  ) const declarative remote as Boolean 
 |  { 
 |    Description: 'Check if the given trip can create a new product in trip based on the product' 
 |    TextBody: 
 |    [* 
 |      // Do not allow user to create new product if it has already existed in the trip 
 |      cancreatenew := not exists( trip, ProductInTrip.Product_MP, p, p = product  ); 
 |      if( not cancreatenew ) 
 |      { 
 |        feedback_o := Translations::MP_ProductInTrip_CanCreate_ProductAlreadyExist( product ); 
 |      } 
 |       
 |      return cancreatenew; 
 |    *] 
 |  } 
 |  
  |