| Quintiq file version 2.0 | 
| #parent: #root | 
| Method CreateRoutingStepAndAddUnits ( | 
|   Units units | 
| ) as owning Operations | 
| { | 
|   Description: | 
|   [* | 
|     Create a routing step when a unit is dragged into the canvas, and add the unit as operation. Used in designer. | 
|     Routing step name will be derived from unit. | 
|   *] | 
|   TextBody: | 
|   [* | 
|     // Adhi Feb-4-2016 (created) | 
|     // If multiple units are added, the name will be derived from the first unit | 
|     name := RoutingStep::GetNewCopiedRoutingStepName( units.Element( 0 ), | 
|                                                       this ); | 
|      | 
|     // New routing step | 
|     rs := RoutingStep::Create( this, name, '', false ); | 
|      | 
|     // Add a unit to routing step to create an operation | 
|     operations := rs.AddOperations( units ); | 
|      | 
|     return &operations; | 
|   *] | 
| } |