Quintiq file version 2.0
#parent: #root
Method InitializeDataHolder (
  structured[StockingPointInPeriod] selection
) id:Method_DialogCreateEditStockingPointCapacity_InitializeDataHolder
{
  #keys: '[151892.0.52021090]'
  Body:
  [*
    //Initialize dataholder
    firstElement := selection.Element( 0 );
    data := shadow( firstElement.StockingPointCapacity() );
    
    if( isnull( data ) or data.Start() <> firstElement.Start().Date() )
    {
      data := firstElement.StockingPoint_MP().StockingPointCapacity( relshadow,
                                                                     StockingPointID := firstElement.StockingPointID(),
                                                                     Start := firstElement.Start().Date(),
                                                                     MaxCapacity := firstElement.MaxCapacity()
                                                                    );
    }
    
    DataHolderDialogData.Data( &data );
    DataHolderDialogDatas.Data( selection.Copy() );
    
    this.InitializeComponents(); 
    
    ApplicationMacroPlanner.ShowFormModal( this );
  *]
}
