# Show-BomWindow ```{toctree} :glob: true :hidden: true show-bomwindow/* ``` Opens the [BOM Window]() for checking and transferring BOM's and materials of Vault [Files]() or [Items](). ## Syntax ```{code-block} powershell :linenos: true Show-BomWindow [-Entity] [] ``` ## Parameters | Type | Name | Description | Optional | |-----------|--------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|----------| | PSObject | Entity | The main Vault entity for which the BOM will retrieved and displayed.
Typically, a powerVault [File]() or [Item]() object is passed.| no | ## Return type **void** ## Remarks The []() retrieves the BOM tree for the passed **-Entity** by calling the method [Get-BomRows]() recursively.\ Such root elements must provide at least [entity properties]() as those provided by powerVault [File]() or [Item]() objects.\ However also [custom BOM properties](), such as those available on powerVault [FileBomRows]() and [ItemBomRows](), can be passed and [displayed as columns](). In order to customize the Check- and Transfer operations for BOMs and Items, the following functions are required additionally and must be implemented with custom logic: :::{admonition} Required Functions - [Check-Boms]() - [Check-Items]() - [Get-Bomrows]() - [Transfer-Boms]() - [Transfer-Items]() ::: ## Examples **Showing the BOM of a Vault Item:** ```{code-block} powershell :linenos: true $item = Get-VaultItem -Number '100001' function Get-BomRows($bomHeader) { return (Get-VaultItemBom -Number $bomHeader._Number) } function Check-Items($items) { } function Transfer-Items($items) { } function Check-Boms($boms) { } function Transfer-Boms($boms) { } Show-BomWindow -Entity $item ``` **Opening the Bom-Window for a Vault file with simple implementation of Check- and Transfer operations:** ```{code-block} powershell :linenos: true $file = Get-VaultFile -Properties @{'File Name'='Catch Assembly.iam'} function Get-BomRows($bomHeader) { return (Get-VaultFileBom -File $bomHeader._FullPath) } function Check-Items($items) { foreach($item in $items) { $item | Update-BomWindowEntity -Status 'New' } } function Transfer-Items($items) { foreach($item in $items) { $item | Update-BomWindowEntity -Status 'Identical' } } function Check-Boms($boms) { foreach($bom in $boms) { $bom | Update-BomWindowEntity -Status 'New' } } function Transfer-Boms($boms) { foreach($bom in $boms) { $bom | Update-BomWindowEntity -Status 'Identical' } } Show-BomWindow -Entity $file ``` **Force the Bom-Window to be displayed in german culture:** ```{code-block} powershell :linenos: true [CultureInfo]::DefaultThreadCurrentUICulture = [CultureInfo]::CreateSpecificCulture('de-DE') $file= Get-VaultFile -File '$/Designs/Pad Lock/Assemblies/Catch Assembly.iam' Show-BomWindow -Entity $file ``` **Full example to display, check and tranfer a BOM of a Vault File or Item to the powerGateServer ERP Plugin:**\ Download example: {download}`BomWindow_RequiredFunctions.ps1 ` ```{code-block} powershell :linenos: true $file = Get-VaultFile -Properties @{'File Name'='MSB-Weld.iam'} if($file._HasModelState) { $allModelStates = Get-VaultFileBom -File $file._FullPath -ModelStateType All $file = $allModelStates | Where-Object { $_.Bom_ModelState -eq 'Face Machining + Treading' } } Show-BomWindow -Entity $file $item = Get-VaultItem -Number '100018' Show-BomWindow -Entity $item ``` More plugins can be found [here]() .