Lai,Risheng
2023-11-02 30c02e0c981b16be0918483543f4b812956c45d4
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
Quintiq file version 2.0
#parent: #root
StaticMethod LinkOperation (
  Operation sourceoperation,
  Operation destinationoperation,
  output OperationLinks trash
) as OperationLink
{
  Description: 'Create operation link between source operation to destiantion operation.'
  TextBody:
  [*
    // DWE2 Feb-1-2016 (created)
    
    defaultqty := sourceoperation.MacroPlan().GlobalParameters_MP().DefaultOperationInputOutputQuantity();
    
    sourcegroupid := BaseOperationLink::GetGroupID( sourceoperation, false, true );
    
    // We only assign to the same input group if the source and destination have the same uom
    destinationgroupid := OperationLink::GetDestinationGroupID( sourceoperation, destinationoperation );
    
    ol := OperationLink::CreateOrDelete( sourceoperation,
                                         destinationoperation,
                                         trash,
                                         sourcegroupid,
                                         destinationgroupid,
                                         defaultqty,   // Source quantity
                                         false,        // destination has user quantity
                                         defaultqty,   // destination quantity
                                         defaultqty,   // destiantion min quantity
                                         defaultqty,   // destination max quantity
                                         defaultqty ); // destination group quantity
    
    return ol;
  *]
}