Quintiq file version 2.0
#parent: CustomDrawComponent
Response OnClick (
  structured[Node] selection
) id:Response_CustomDrawComponent_MenuDeleteNode_OnClick
{
  #keys: '[110880.3.1008500266]'
  Body:
  [*
    // Delete nodes
    
    // For product nodes, remove it from pisp, the rest of the nodes, delete.
    pisp := selectset( selection,
                       Elements.astype( ProductNode ).Product_MP.ProductInStockingPoint_MP,
                       pisp,
                       true,
                       pisp.StockingPoint_MP() = DataHolderFocusedSP.Data() )
    if ( pisp.Size() > 0 )
    {
      MacroPlan::DeleteObjects( pisp );
    }
    else
    {
      Node::Delete( selection );
    }
    
    // Toggle on value holder to indicate changes
    ApplicationLibMacroPlanner.SetSupplyChainOverviewWarning();
  *]
  CanBindMultiple: false
  DefinitionID => /CustomDrawComponent/Responsedef_CustomDrawComponent_Menu_OnClick
  Initiator: 'MenuDeleteNode'
  UserRequiresReadWrite: true
}
