Quintiq file version 2.0
#parent: ListFulfillmentRestriction
Response OnClick () id:Response_ListFulfillmentRestriction_MenuCreate_OnClick
{
  #keys: '[135040.0.186419311]'
  CanBindMultiple: false
  DefinitionID => /ListFulfillmentRestriction/Responsedef_ListFulfillmentRestriction_WebMenu_OnClick
  Initiator: 'MenuCreate'
  Precondition:
  [*
    ssegments   := ifexpr( DataHolderSelectedSalesSegmentFrmSalesSegment.Data().Size() >0, 
                           DataHolderSelectedSalesSegmentFrmSalesSegment.Data(), 
                           DataHolderSalesSegment.Data() );
    
    products    := DataHolderProduct.Data();
    
    return MacroPlan::HasMacroPlan( MacroPlan, feedback )
           and FulfillmentRestriction::CanCreate( MacroPlan, feedback )
           and FulfillmentRestriction::CanCreateWeb( feedback, ssegments, products );
  *]
  UserRequiresReadWrite: true
  QuillAction
  {
    Body:
    [*
      // New fulfillment restriction
      ssegments   := ifexpr( DataHolderSelectedSalesSegmentFrmSalesSegment.Data().Size() >0, 
                             DataHolderSelectedSalesSegmentFrmSalesSegment.Data(), 
                             DataHolderSalesSegment.Data() );
      products := DataHolderProduct.Data();
      
      dlg := construct( DialogCreateEditFulfillmentRestriction );
      dlg.New( ssegments, products );  //create new fulfillment restriction with the selected SalesSegments + children
    *]
    GroupServerCalls: false
  }
}
