yanweiyuan3
2023-10-27 d1d15b61dfcf7fd0f800b32359f082cf580ed556
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
Quintiq file version 2.0
#parent: #root
Method ChangeOwner (
  Product_MP selectionProduct,
  StockingPoint_MP selectionSP
) id:Method_DialogCreateEditInventoryCost_ChangeOwner
{
  #keys: '[145730.1.250668143]'
  Body:
  [*
    // Owner changes is only allowed for single create/edit
    // No relshadow needed since the owner is only sourced from dataholder
    if( DataHolderPISPs.Data().Size() <= 1 )
    {
      // Find the new PISP from nav panel selection, populate new PISP into DH
      newpisp := selectset( DataHolderPISP.Data(), Elements, pisp, pisp.Product_MP() = selectionProduct,
                                                                               pisp.StockingPoint_MP() = selectionSP )
      DataHolderPISPs.Data( &newpisp );
    }
    // Update cost label after owner changes
    this.SetCostLabel( DropDownStringListCostDriver.Text() );
  *]
}