ironmansoftware / issues

Public Issue tracker for Ironman Software products.
https://ironmansoftware.com
32 stars 2 forks source link

UDTable in UDDynamic "e is undefined" #3346

Open ganslm opened 1 month ago

ganslm commented 1 month ago

Version

4.2.21

Severity

Medium

Environment

msi

Steps to Reproduce

Create a UDTable in a UDDynamic and refresh the Table Column Values a few times.

Here´s a example how i use this right now:

Function Sync-Logs-Disable-ADUser {
    param(
        $id,
        $result,
        $ErrorMessage
    )

    # Iterate through the array
    foreach ($entry in $page:eventreturndata) {
        if ($entry.ID -eq $id) {

            $entry.Ergebnis = $result;
            $entry.Fehlermeldung = $ErrorMessage;
            break;
        }
    }

    Sync-UDElement -Id 'dynamicresult';
}

#Prepare Array for Job Return
$page:eventreturndata = @(
    @{ID = 1; Ergebnis = "clock"; Funktion = "RenameADUser"; Fehlermeldung = "" }
    @{ID = 2; Ergebnis = "clock"; Funktion = "SetADDeletetionDate"; Fehlermeldung = "" }
    @{ID = 3; Ergebnis = "clock"; Funktion = "RemoveFromAddressbook"; Fehlermeldung = "" }
    @{ID = 4; Ergebnis = "clock"; Funktion = "MoveADOU"; Fehlermeldung = "" }
    @{ID = 5; Ergebnis = "clock"; Funktion = "DisableADUser"; Fehlermeldung = "" }
    @{ID = 6; Ergebnis = "clock"; Funktion = "ConvertMailbox"; Fehlermeldung = "" }
    @{ID = 7; Ergebnis = "clock"; Funktion = "DisableMailForwarding"; Fehlermeldung = "" }
    @{ID = 8; Ergebnis = "clock"; Funktion = "SetMailboxAutoReply"; Fehlermeldung = "" }
    @{ID = 9; Ergebnis = "clock"; Funktion = "RemoveM365Licenses"; Fehlermeldung = "" }
)

Show-UDModal -Content {
    New-UDTypography -Text "Deaktivierungsstatus" -Variant "h5";

    New-UDHtml -Markup '<br>';

    New-UDDynamic -Id 'dynamicresult' -Content {
        New-UDTable -Id 'tableresult' -Data $page:eventreturndata -Columns @(
            New-UDTableColumn -Property 'Status' -Render {
                New-UDIcon -Icon $EventData.ergebnis;
            }

            New-UDTableColumn -Property 'Funktion';
            New-UDTableColumn -Property 'Fehlermeldung';
        )
    }
} -Persistent -Footer {
    New-UDButton -Text "Schließen" -OnClick { Hide-UDModal };
} -FullWidth

Sync-Logs-Disable-ADUser -Id 1 -result "play";
Sync-Logs-Disable-ADUser -Id 1 -result "check";

(I also have this Problem, when i remove the Icons from the Table)

Expected behavior

Run my script and refresh the Status Icons in the Table accordingly (see Screenshot 1).

Actual behavior

Very sporadically (like every 5 runs) the Table (or Dynamic breaks) and shows "Error e is undefined" in the UDModal and some Error Toasts "Collection was modified; enumeration operation may not execute" (see Screenshot 2).

I have provided the system logs in the attachments and the error last occurred on 22.05.2024 at 11:00 am.

Additional Environment data

Operating System: Windows Server 2022 Datacenter

Screenshots/Animations

grafik grafik systemLog20240522_002.txt

rstolpe commented 1 month ago

Got the same but mine was due to empty property so I did fix that instead. But it would be better if psu replayed that it was empty

adamdriscoll commented 3 weeks ago

I can't reproduce this at the moment. Can you please press F12 in your browser and get the error stack trace that is present?

ganslm commented 2 weeks ago

I uploaded what I could find. I hope this is what you need. e is undefined.txt

Thank you.