coolOrangeLabs / powerGateTemplate

powerGate full functional sample ERP integration
MIT License
3 stars 3 forks source link

ERP Item tab shows Error dialog, when no connection to ERP Service #229

Closed JakobBertagnolli closed 1 year ago

JakobBertagnolli commented 1 year ago

When there is no connection to ERP Service and the ERP Item tab gets selected in Vault an error dialog apperes: image

This error message is caused by a called function GetCategoryList() inside the ERP Item.xaml file: <ComboBox Name="Category" SelectedValue="{Binding Entity.Category}" DisplayMemberPath="Value" SelectedValuePath="Key" Grid.Column="1" Grid.Row="0" ItemsSource="{Binding DataContext.PsList[GetCategoryList], ElementName=MainWindow}" />

Within this function the commandlet Get-ERPObjects is called and triggers the error dialog: $categories = Get-ERPObjects -EntitySet "Categories"

How to reproduce the issue:

Note: Sometimes the error dialog apperes two times because for some reason Datastandard triggerd the OnTabContextChanged() function twice. If Vault gets started and the ERP Item tab was selected automatically, this error dialog will appear 3 to 4 times.

TollJulian commented 1 year ago
  1. I was not able to reproduce this issue. Just the red message in top of the tab was visible to me, but no error window.
  2. I had to comment out a codeline in powerGateMain.ps1 to open the Item- and BOM Tab without Datastandard- and powerEvents errors. A check with $dsDiag.Inspect() showed me, that the variable $searchWindow is not available. (see below)

image

image

Please advise!

TollJulian commented 1 year ago

Issue already fixed by @lustricker (https://github.com/coolOrangeLabs/powerGateTemplate/commit/578d286bc6f57a45445840530b7abc3831e5f8cf)

To problem n.1 from above: The variable name must be $dsWindow instead of $searchWindow. Has been fixed in https://github.com/coolOrangeLabs/powerGateTemplate/commit/03e3bb5f1aa0aa631203c09de62835d7482ff734 by @TollJulian

I close this issue