ALAppExtensions icon indicating copy to clipboard operation
ALAppExtensions copied to clipboard

Data Administration Refresh action crashes client with "Something went wrong" message

Open ViktorasDanielius opened this issue 3 years ago • 1 comments

Open Data Administration and select Refresh action. Progress bar goes to 100% and then client crashes with "Something went wrong" message.

Event log shows error: Call to the function 'MODIFY' is not allowed inside the call to 'TryCalcThirtyDayGrowthForTable' when it is used as a TryFunction.

ALCallStack: "Table Information Cache Impl."(CodeUnit 8700).TryCalcThirtyDayGrowthForTable line 17 - System Application by Microsoft "Table Information Cache Impl."(CodeUnit 8700).CalcThirtyDayGrowth line 7 - System Application by Microsoft "Table Information Cache Impl."(CodeUnit 8700).RefreshTableInformationCache line 28 - System Application by Microsoft "Table Information Cache"(CodeUnit 8701).RefreshTableInformationCache line 4 - System Application by Microsoft "Table Information Cache"(CodeUnit 8701).OnRun(Trigger) line 2 - System Application by Microsoft

Function TryCalcThirtyDayGrowthForTable is TryFunction and it has Modify command:

    [TryFunction]
    local procedure TryCalcThirtyDayGrowthForTable(var TableInformationCache: Record "Table Information Cache")
    var
        RecordRef: RecordRef;
        FieldRef: FieldRef;
    begin
        RecordRef.Open(TableInformationCache."Table No.");
        if not (TableInformationCache."Company Name" in ['', CrossCompanyDataLbl, CompanyName()]) then
            RecordRef.ChangeCompany(TableInformationCache."Company Name");

        FieldRef := RecordRef.Field(RecordRef.SystemCreatedAtNo);
#pragma warning disable AA0217
        FieldRef.SetFilter(StrSubstNo('''''|<%1', CreateDateTime(CalcDate('<-30D>', Today), 0T)));
#pragma warning restore AA0217
        TableInformationCache."Last Period No. of Records" := RecordRef.Count();
        TableInformationCache."Last Period Data Size (KB)" := Round((RecordRef.Count() * TableInformationCache."Record Size" / 1024), 1);
        if TableInformationCache."Last Period Data Size (KB)" <> 0 then
            TableInformationCache."Growth %" := Round(((TableInformationCache."Data Size (KB)" / TableInformationCache."Last Period Data Size (KB)") - 1), 0.01) * 100;
        TableInformationCache.Modify();
        RecordRef.Close();
    end;

ViktorasDanielius avatar Jun 08 '23 06:06 ViktorasDanielius

Thanks for reporting this, we're shipping a fix in the next minor.

stkillen avatar Jul 25 '23 08:07 stkillen