coolOrangeLabs / powerGateTemplate

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

Check-BOMs $differences werden alle zusammen ausgelesen #157

Closed JakobBertagnolli closed 4 years ago

JakobBertagnolli commented 4 years ago

Problem

Bei großen items mit mehreren files und mehreren items, werden Beim BOM-Check erst alle $differences ausgelesen, und erst am Ende wir das UI aktualisiert. Dass kann dazu führen dass der Kunde bei größeren items, glauben könnte dass nichts weiter geht, und schließt das Window.

Code

https://github.com/coolOrangeLabs/powerGateTemplate/blob/master/Files/DataStandard/Vault.Custom/addinVault/powerGateBomTransfer.ps1

function Check-Boms($entityBoms) {
    $differences = CompareErpBoms -entityBoms $entityBoms
    foreach($diff in $differences){
          if($diff.Status -eq "Remove" -and $diff.Parent) {
              $remove = Add-BomWindowEntity -Parent $diff.Parent -Type BomRow -Properties $diff.AffectedObject
              Update-BomWindowEntity $remove -Status $diff.Status -Tooltip $diff.Message
          }
          else {
          Update-BomWindowEntity -InputObject $diff.AffectedObject -Status $diff.Status -Tooltip $diff.Message            
          }
     }
}

Lösungsvorschlag

Wäre es möglich $differences einzeln auszulesen, und das UI sofort zu aktualisiern, damit der User weiß dass etwas passiert. Eventuell wie bei der methode Check-Items()? @christiangessner @lustricker

lustricker commented 4 years ago

@JakobBertagnolli you used my code at Sotawall. I should have the same code here, does it work at sotawall? can you check if my code on branch 157 matches your working code?

JakobBertagnolli commented 4 years ago

@lustricker The code on branch 157 matches the code from Sotawall. It is a good workaround for the problem, but there is still a non critical bug with the progress bar. I sent the problem to the coolOrange Support. Ticket: https://support.coolorange.com/support/tickets/4032 Issue Sotawall: https://github.com/coolOrangeProjects/Sotawall/issues/61