Quintiq file version 2.0
#parent: #root
Method EditStockingPointCapacity (
  internal[GUIComponent] parent,
  structured[StockingPointCapacity] selection
) id:Method_DialogCreateEditStockingPointCapacity_EditStockingPointCapacity
{
  #keys: '[107528.0.125967397]'
  Body:
  [*
    // Edit stocking point capacity
    
    isbatchedit := selection.Size() > 1;
    Dialog.EnableDisableComponent( isbatchedit );
    
    Dialog.ShowHideComponents( false );
    
    data := shadow( selection.Element( 0 ) );
    Dialog.Data( data );
    
    result := this.DoModal( parent );
    
    if( result > 0 )
    {
      StockingPointCapacity::Update( selection,
                                     data.StockingPoint_MP(),
                                     GUIStartDateTimeSelector.DateTime().Date(), // Read-only, apply changes to shadow is not taking place for read-only attribute when editing.
                                     data.MaxCapacity() );
    }
  *]
}
