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
  | Quintiq file version 2.0 
 |  #parent: #root 
 |  Method LinkToStockingPoint ( 
 |    StockingPoint_MP stockingpoint, 
 |    Boolean isinput 
 |  ) as StockingPointUnit 
 |  { 
 |    Description: 'Link the unit to stocking or vise-versa.' 
 |    TextBody: 
 |    [* 
 |      // DWE2 Apr-8-2016 (created) 
 |      spu := StockingPointUnit::FindStockingPointUnitTypeIndex( stockingpoint.ID(), this.ID(), isinput ); 
 |       
 |      if( isnull( spu ) ) 
 |      { 
 |        spu := this.StockingPointUnit( relnew, 
 |                                       StockingPoint_MP := stockingpoint,  //Set the stocking point so that this relation can be used in the same transaction without propagation 
 |                                       UnitID := this.ID(), 
 |                                       StockingPointID := stockingpoint.ID(), 
 |                                       IsInput := isinput ); 
 |      } 
 |       
 |      return spu; 
 |    *] 
 |  } 
 |  
  |