Update powerGate to current version

Summary of changes that need to be done when updating powerGate to current version

When updating to the current version execute all the steps after your current version to the end. For example when updating from v20.0.7 to current version start with instructions for 21.0.16.

17.1.68

See: breaking changes

Customization has to be updated in locations using Connect-ErpDisconnect-ERPGet-ERPServicesGet-ERPObjectGet-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

19.0.14

See: breaking changes

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

20.0.7

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

21.0.13

See: breaking changes

Some cmdlets return empty array:

The customization should be updated in places that use the results of the following cmdlets: Get-ERPEntityTypesGet-ERPEntitySetsGet-ERPServices and Get-ERPObjects

They no longer return $null in case of error, but an empty array instead.

$entities = Get-ERPObjects -EntitySet $documentEntitySet 

if($null -eq $entities){
  ...
}

if(-not $entities){
   ....
}

.NET library:

The GetErpObject(...) function of the IErpEntitySet interface from the .NET Library no longer raises exceptions if the ERP object could not be found.
Customizations that verify such error results should therefore be adapted.
try {
   var item = erpClient.Services["InforVisual"].EntitySets["Materials"].GetErpObject(keys);

catch (WebRequestException ex) {
  if(ex.StatusCode == 404) {
    ....
  }
}

var item = erpClient.Services["InforVisual"].EntitySets["Materials"].GetErpObject(keys);
if(item == null) {
   ....
}

21.0.14

See: breaking changes

The -Tooltip parameter of the Update-BomWindowEntity Cmdlet was renamed to -statusDetails.
Update your code to use -StatusDetails instead of -Tooltip.

The property "_Tooltip" of the BOM, BomRow and Item object were renamed to "_StatusDetails". Update your code to use "_StatusDetails" instead of "_Tooltip"

21.0.16

See: breaking changes

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 Length' 

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.

 

22.0.1

See: Changes

Changes to powerGate

Message Boxes:

This version provides improved error messages on connection issues with powerGateServer. Therefore you should remove all usages of message boxes that are used to display connection issues to the user. Otherwise multiple messages are likely displayed.

Changes to powerGate Server

Requires at least powerGateServer 21.0.5

The webservice path needs to be prefixed with a 'PGS/' to ensure it can be distinguished in situations without any response.

[WebServiceData("PGS/{my_original_path}","{my_web_service_name}")]

Afterwards the url to the PGS plugin must be adapted within all custom ERP integrations: 'Connect-ERP 'http://{pgs-machine}:8080/PGS/{my_original_path}/{my_web_service_name}'

23.0.1

See: breaking changes

powerGate now requires Vault Professional Client to be installed on the same machine. Due to this we had to provide new setups that are not able to update Vault Workgroup (any version) or Vault Professional (2020 or older)

Starting with powerGate 23.0.8 it is possible to update the PowerShell cmdlets and .NET libraries only without installing any of the Vault tabs or connection scripts. This can be done by installing powerGate via command line with the parameter "VAULT_ERP_INTEGRATION=0".

23.0.4

See: Breaking changes

In this version new ERP Tabs have been introduced for Vault Files and Items.

When upgrading an existing Vault Data Standard customization from v22.0 or older you can avoid duplicate tabs, by moving all files starting with "Sample." in C:\ProgramData\coolOrange\powerEvents to C:\ProgramData\coolOrange\powerEvents\Disabled.

💡This is not necessary anymore when updating to 24.0.2 or newer.

CatalogService automatically connects to services

This section used to describe to disable Sample.ConnectToPowerGateServer.ps1.

💡This is not necessary anymore when updating to 23.0.12 or newer, as the script is disabled per default.

As CatalogService now automatically connects to all available services invalid connections to dummy services could happen. Make sure the dummy "ERP" service is not installed on any live powerGateServer system.

23.0.8

In this version an install switch has been introduced that allows to install only the main components of powerGate (Cmdlets.NET SDK), without powerEvents and without the erp tabs.

Using VAULT_ERP_INTEGRATION=0 is only recommended when:

  • Installing powerGate on the Job Processor
  • Upgrading an existing customization on a system with Vault Workgroup (any version) or Vault Professional (2020 or older)

 

The switch should not be used when upgrading an existing Vault Data Standard customization from v22.0 or older. To avoid duplicate tabs continue to move all files starting with "Sample." in C:\ProgramData\coolOrange\powerEvents to C:\ProgramData\coolOrange\powerEvents\Disabled.

💡This is not necessary anymore when updating to 24.0.2 or later.

24.0.1

See: Changes

Visual studio projects, using .NET 4.5 or older need to be updated to use .NET 4.7 or newer

24.0.2

See: Changes

Install switch changed:

In this version the VAULT_ERP_INTEGRATION switch has been changed to MAIN_COMPONENTS_ONLY.

Using MAIN_COMPONENTS_ONLY=1 is only recommended when:

  • Installing powerGate on the Job Processor
  • Upgrading an existing customization on a system with Vault Workgroup (any version) or Vault Professional (2020 or older)

Error behavior in Datastandard changed:

Error dialogs in Datastandard have been removed. To enable them again put the following script in any of your scripts. It must be set as early as possible.

Import-Module powerGate
$global:Host.PrivateData.OnNonTerminatingError = $global:deprecated_defaultErrorBehaviorForVDS