| Quintiq file version 2.0 | 
| #parent: #root | 
| StaticMethod Update ( | 
|   OperationBOMs operationBOMs, | 
|   Product_MP product, | 
|   StockingPoint_MP stockingpoint | 
| ) | 
| { | 
|   Description: 'Update of stocking point and product of bom' | 
|   TextBody: | 
|   [* | 
|     isbatchedit := operationBOMs.Size() > 1; | 
|      | 
|     traverse( operationBOMs, Elements, bom ) | 
|     { | 
|      productid := ifexpr( isbatchedit, bom.ProductID(), product.ID() ); | 
|      // Only assign to a new PISP if it does not exist yet | 
|       existingbom := OperationBOM::FindOperationBOMTypeIndex( bom.OperationID(), | 
|                                                               productid, | 
|                                                               stockingpoint.ID(), | 
|                                                               bom.IsInput() ); | 
|      | 
|       if( isnull( existingbom ) ) | 
|       { | 
|         bom.AssignToStockingPoint( stockingpoint ); | 
|         //only update when is not batchedit | 
|         if( not isbatchedit ) | 
|         { | 
|           bom.AssignToProduct( product ); | 
|         }   | 
|       } | 
|     } | 
|   *] | 
| } |