Get-VaultItemBom -Recursive returns partial row numbers

When calling Get-VaultItemBom with the -Rrecursive switch the Bom_RowOrder property only contains the row order of the position, but not of the parent.

Issue

When calling Get-VaultItemBom with the -Rrecursive switch the Bom_RowOrder property only contains the row order of the position, but not of the parent. For example:

0001
|-> 0002
|-> 0003
|->0004

0001 has Bom_RowOrder 1

0002 has Bom_RowOrder 1

0003 has Bom_RowOrder 2

0004 has Bom_RowOrder 1

Cause

This is currently under investigation

Solution

As a workaround you can use the below code to generate the bom positions recursively and add the concatenated row order as a new property

function Get-VaultItemBomPositionsRecursive($Parent) {

  if(-not $Parent) {
      return @()
    }

    $bomRow = Get-VaultItemBom -Number $Parent._Number

  $bom = @()
    foreach($position in $bomRow) {

      $concatenatedRowOrder = ("$($Parent.Bom_RowOrder).$($position.Bom_RowOrder)").TrimStart('.')
      Add-Member -InputObject $position -MemberType NoteProperty -Name 'Bom_RowOrderConcat' -Value $concatenatedRowOrder
      $bom += $position

        $bom += Get-VaultItemBomPositionsRecursive -Parent $position

    }

  return $bom
}

<# Sample call

Open-VaultConnection
$item = Get-VaultItem -Number FlcRootItem
$bomPositions = Get-VaultItemBomPositionsRecursive -Parent $item
$bomPositions | Select-Object _Number, Bom_RowOrderConcat

#>

 

 

 

asdf