Quintiq file version 2.0 
 | 
#parent: GanttChartDemandSupplyGroup 
 | 
Response OnClick ( 
 | 
  structured[ProductInStockingPointInPeriodPlanningLeaf] selection 
 | 
) id:Response_GanttChartDemandSupplyGroup_MenuCreateSalesDemands_OnClick 
 | 
{ 
 | 
  #keys: '[110880.8.28706166]' 
 | 
  Body: 
 | 
  [* 
 | 
    //Create dummy sales demands 
 | 
    if( selection.Size() = 1 ) 
 | 
    { 
 | 
      dlg := construct( DialogCreateEditSalesDemand ); 
 | 
      dlg.NewSalesDemandFromProductInStockingPointInPeriod( this, selection.Element( 0 ) ); 
 | 
    } 
 | 
    else 
 | 
    { 
 | 
      ProductInStockingPointInPeriod::CreateSalesDemands( MacroPlan, selection ); 
 | 
    } 
 | 
  *] 
 | 
  CanBindMultiple: false 
 | 
  DefinitionID => /GanttChartDemandSupplyGroup/Responsedef_GanttChartDemandSupplyGroup_Menu_OnClick 
 | 
  Initiator: 'MenuCreateSalesDemands' 
 | 
  Precondition: 
 | 
  [* 
 | 
    return SalesSegment_MP::HasSalesSegment( MacroPlan, feedback ) 
 | 
           //and ProductInStockingPointInPeriod::GetIsAllLeafProduct( feedback, selection ); 
 | 
  *] 
 | 
} 
 |