Manipulates the BOM of an existing Item in Fusion Lifecycle.

Update-FLCBOM -Workspace <String> -ItemId <Long> -Rows <Object[]> [<CommonParameters>]

Update-FLCBOM -InputObject <PSObject> -Rows <Object[]> [<CommonParameters>]

Type Name Description Optional
StringWorkspaceThe name of the workspace that contains the header Itemno (optional when InputObject is used)
LongItemIdThe ID of the BOM header Itemno (optional when InputObject is used)
ItemInputObjectThe Fusion Lifecycle header Item. The argument accepts pipeline inputno (optional when Workspace and ItemId are used)
(Hashtable/PsObject)[]RowsOverrides all BOM line items with the passed BOM line items informationno

BomRow[] ← on success.
empty ← on failure. Exception/ErrorMessage can be accessed using $Error.

The commandlet can be used to add existing Items to a BOM, edit BOM line items and delete Items from a specific BOM in Fusion Lifecycle.

The passed -Workspace has to be configured properly and must allow linking the passed items.

In order to override the current BOM line items the -Rows argument allows passing BOM information for Items from different Workspaces that should be added or edited on the according header Item.
All the BOM items that are not present in the array will be deleted from the BOM (not from the Workspace).

The required information for linking Fusion Lifecycle Items can be passed using the Workspace and Id properties.
For BOM line items from ​revision-controlled​ Workspaces the latest versions of the passed items are linked.

The argument allows passing the name and value for all the Standard BOM Fields and Custom BOM fields using the 'Bom_' prefix (e.g Bom_Quantity) regardless of the used display names in the different BOM Views.
Only BOM Fields that are assigned to a View in the Bill of Materials Tab can be specified.
For those BOM fields which are not present in the Hashtable or PsObject, a configured default value is used when a new line item is added. For example auto-numbering is used when no Bom_PositionNumber field is supplied.
When editing existing BOM line items, the value in Fusion Lifecycle is kept untouched.
Additional information about the limitations and requirements of the possible BOM Field Types can be found here.

Not editable Fields

Fields that are not editable in the Bill of Materials Tab (e.g. computed Roll Up Fields) can not be updated using this cmdlet.

To use the examples below a Fusion Lifecycle PLM demo Tenant is required:

Update a BOM and its fields for an Item in Fusion Lifecycle

Connect-FLC -Tenant 'your_tenant_name' -ClientId 'your_client_id' -ClientSecret 'your_client_secret' -UserId 'your_email@example.com'
$bomRows = Update-FLCBOM -Workspace 'Products' -ItemId 7557 -Rows @(
    'Bom_PositionNumber'=1            #Field Type: Integer
    'Workspace' = 'Products'
    'Bom_Quantity'= 6.96              #Field Type: Float
    'Workspace' = 'Items and BOMs'
    'Id' = 8065
    'Bom_CustomCheckbox' = $false     #Field Type: Check Box

Override only specific line items in a BOM

Connect-FLC -Tenant 'your_tenant_name' -ClientId 'your_client_id' -ClientSecret 'your_client_secret' -UserId 'your_email@example.com'
$item = (Get-FLCItems -Workspace 'Items and BOMs' -Filter '"699-00007 - BAC Mono mk1 custom steering wheel"')[0]

# all the filtered out items will be removed
$existingBomRows = ($item | Get-FLCBOM) | Where-Object { $_.Description -ne 'Push Button' }
$existingBomRows[0].Bom_Quantity = 2.0
$newBomRows = (Get-FLCItems -Workspace 'Items and BOMs' -Filter '"Push Button"') | Select-Object -Property Workspace, Id, @{Name = 'Bom_Quantity'; Expression = {1.0}}

$bomRows = $item | Update-FLCBOM -Rows ($existingBomRows + $newBomRows)

Create a BOM and its associated Items in Fusion Lifecycle from the Structured BOM of a Vault File

Connect-FLC -Tenant 'your_tenant_name' -ClientId 'your_client_id' -ClientSecret 'your_client_secret' -UserId 'your_email@example.com'
$file = Get-VaultFile -Properties @{Name = 'Pad Lock.iam'}
$fileBom = Get-VaultFileBOM -File $file._FullPath

$flcBomRows = @()
foreach($fileBomRow in $fileBom) {
    $flcBomRowItem = Add-FLCItem -Workspace 'Items and BOMs' -Properties @{
        'Description' = $fileBomRow._PartNumber
        'Unit of Measure' = 'Each'
    $flcBomRows += @{
        'Id' = $flcBomRowItem.Id
        'Workspace' = $flcBomRowItem.Workspace
        'Bom_PositionNumber' = $fileBomRow.Bom_PositionNumber
        'Bom_Quantity' = $fileBomRow.Bom_Quantity

$flcItem =  Add-FLCItem -Workspace 'Items and BOMs' -Properties @{'Description' = $file._PartNumber}
$flcBomRows = $flcItem | Update-FLCBOM -Rows $flcBomRows

Error handling, analyze why adding Items to a BOM failed using $Error

Connect-FLC -Tenant 'your_tenant_name' -ClientId 'your_client_id' -ClientSecret 'your_client_secret' -UserId 'your_email@example.com'

$childItems = Get-FLCItems -Workspace 'Items and BOMs' -Filter 'ITEM_DETAILS:DESCRIPTION="Gear Shift Paddle"'

$bomRows = Update-FLCBOM -Workspace 'Items and BOMs' -ItemId 8071 -Rows $childItems

if(-not $bomRows){
   $Error[0].Exception # Returns "error.bom.cyclical: Saving these changes produces a cyclical BOM, this is not permitted"

Error handling, analyze why several bomRows could not be updated using $Error

Connect-FLC -Tenant 'your_tenant_name' -ClientId 'your_client_id' -ClientSecret 'your_client_secret' -UserId 'your_email@example.com'

$bomRows = Update-FLCBOM -Workspace 'Items and BOMs' -ItemId 6862 -Rows @(
            'Workspace' = 'Items and BOMs'
            'Bom_PositionNumber'= "Invalid_Pos"   #Invalid position number    
            'Workspace' = 'Items and BOMs'
            'Id' = 0                              #Invalid item Id

if(-not $bomRows){
   $Error[0].Exception                   # Returns System.AggregateException: "One or more errors occurred."
   $Error[0].Exception.InnerExceptions   # Returns: "Input string was not in a correct format."
                                         #          "No Item found with the given id: 0."