This article offers an overview of the breaking changes and the recommended changes so that your customization still works after an upgrade.


When upgrading from e.g. version v19 to v21 make sure to follow the steps to upgrade to the latest v19 version first, then follow the steps for upgrading to v20 and finally to v21.


Upgrade toChanges
v17

Customization has to be updated in locations using Connect-Erp, Disconnect-ERP, Get-ERPServices, Get-ERPObject, Get-ERPObjects, Remove-ERPObject, Update-ERPObject, Add-ERPObject, Update-ERPObject and Add-ERPObject


Usages for cmdlets like Get-ERPConnectionStatus, Resolve-ERPObject, Get-ERPEntities, Add-ERPDir, Update-ERPDir and powerGateErrors variable have to be removed in the scripts


PowerShell scripts containing Show-ErpWindow have to use Show-BomWindow instead

See: breaking changes

v19

When upgrading to this version remove the StoredLayout files


Customizations with global PowerShell variables or other cachings may have to be updated in when conflicts arise because required BomWindow functions are executed in current runspace


Scripts expecting Get-BomRows to be called automatically after Add-BomWindowEntity  have to be adapted

See: breaking changes

v20

Register the Serial Number for v20 products (and later) on your environments

v21
Upgrading other products to v21 may be required, as described in this article


When BOM row properties are directly passed from Get-ERPObjects cmdlet to Add-BomWindowEntity -Propertiesthey should be updated to be passed as BOM properties with a "Bom_" prefix.   

$addedBomRow = Add-BomWindowEntity -Type BomRow -Parent $bom -Properties @{

    'Effective Length' -> 'Bom_Effective Length' =$erpBomRow.'Effective Length'

}


When accessing these BOM properties from the BomRow object they need to be retrieved using a "Bom_" prefix.


$effectiveLength = $addedBomRow.'Effective Length' -> $addedBomRow.'Bom_Effective LengthUnit


All the other properties are treated as entity properties. They used to be ignored by Update-BomWindowEntity for newly added BOM rows.


$addedBomRow | Update-BomWindowEntity -Status Remove -Properties @{

   'Part Number' = $erpBomRow.ChildNumber # this cmdlet now updates this entity property too

}


Therefore verify if the entity properties that are passed to these cmdlets should be removed or extended with a "Bom_" prefix. It might be sensible to return the BOM information in the Get-BomRows function with "Bom_" prefix.

No changes are necessary when the retrieved ERP data of the related Material should be displayed directly in the BOM Tab.


function Get-BomRows($bomHeader) {

   ...

   $bomRow.PSObject.Properties.Remove('Effective Length') 

   Add-Member -InputObject $bomRow -Name "Bom_Effective Length" -Value $bomRow.Unit -MemberType NoteProperty -Force

   ...

}

function Check-Boms($boms) {

   ...

   $addedBomRow = Add-BomWindowEntity -Type BomRow -Parent $bom -Properties @{

      'Bom_PositionNumber' = $erpBomRow.PositionNumber

      'Number' = $erpBomRow.ChildNumber  -> $erpMaterial.Number # used to be filled with data from ERP BOM but it makes more sense to use material data

      #'Part Number' = $erpBomRow.ChildNumber   # removed because this is an entity property that should not be filled with ERP BOM data

      'Bom_Effective Length' = $erpBomRow.'Effective Length'

   }

   ...

}

When additional columns are enabled for displaying the previously incorrect BOM properties, then they can be removed from the BOM Window as they will be empty in newly created BOM. The passed entity properties will be displayed in the duplicated column instead.

See: breaking changes

See Also

coolOrange Download Zone