# Remove-BomWindowEntity Removes an entity from the [BOM Window](/bom_window). ## Syntax ```{code-block} powershell :linenos: true Remove-BomWindowEntity [[-InputObject] ] [] ``` ## Parameters | Type | Name | Description | Optional | |--------------------------------------------------------------------------------------------------------------------------------------|-------------|----------------------------------------------------------------------------|----------| | [BomRow](/code_reference/commandlets/show-bomwindow/objects/bom) / [Item](/code_reference/commandlets/show-bomwindow/objects/item) | InputObject | An entity displayed in the BOM Window. The argument accepts pipeline input | no | ## Return type **empty** ← On failure the Exception/ErrorMessage can be accessed using [\$Error](https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_automatic_variables?view=powershell-5.1#error). ## Remarks The Cmdlets's purpose is to remove a [BomRow](/code_reference/commandlets/show-bomwindow/objects/bomrow) or an [Item](/code_reference/commandlets/show-bomwindow/objects/item) from the [BOM Window](/bom_window).\ When removing a BomRow, the row and the associated Item will be removed together!\ The same applies when removing an Item that depends on a BomRow: the item and the associated [BomRow](/code_reference/commandlets/show-bomwindow/objects/bomrow) will be removed at the same time. **Restrictions:** - [Items](/code_reference/commandlets/show-bomwindow/objects/item) that are used in multiple [BOM's](/code_reference/commandlets/show-bomwindow/objects/bom) can not be removed - Only [BomRows](/code_reference/commandlets/show-bomwindow/objects/bomrow) without any children can be removed ## Examples **Removing an item from the BOM Window:** ```{code-block} powershell :linenos: true $item | Remove-BomWindowEntity ``` **Removing rows from a BOM:** ```{code-block} powershell :linenos: true foreach($bomRow in $bom.Children) { $bomRow | Remove-BomWindowEntity } ``` **Deletes an item when marked as "Remove" and when successfully deleted in ERP:** ```{code-block} powershell :linenos: true function Transfer-Items($items) { foreach($item in $items) { if($item._Status -eq 'Remove'){ $removed = Remove-ERPObject -EntitySet 'Materials' -Keys @{'Number'=$item._PartNumber} if($removed) { $item | Remove-BomWindowEntity } } } } ```