Quintiq file version 2.0
#parent: #root
Method Edit (
  internal[GUIComponent] parent,
  FulfillmentTarget fulfillmenttarget
) id:Method_DialogCreateEditFulfillmentTarget_Edit
{
  #keys: '[127238.0.1975981162]'
  Body:
  [*
    // Edit FulfillmentTarget
    
    data := shadow( fulfillmenttarget );
    
    Dialog.Data( data );
    
    result := this.DoModal( parent );
    
    if( result > 0 )
    {
      data.WrappedInstance().Update( data.IsEnabled(),
                                     data.Name(),
                                     data.Product_MP(),
                                     data.StockingPoint_MP(),
                                     data.SalesSegment_MP(),
                                     data.TargetPercentage(),
                                     GUIDateTimeSelectorStart.DateTime().Date(), // data wont be applied on disabled component
                                     GUIDateTimeSelectorEnd.DateTime().Date(),
                                     data.IsUsedForSafetyStockCalculation(),
                                     data.IsUsedForPlanningFulfillment(),
                                     false);
    }
  *]
}
