Skip to content

Business Central craches when try to set purchase invoice to read only mode #8219

@linasostr

Description

@linasostr

Business Central craches when try to set purchase invoice document to read only mode.

Issue happens when "Purch. Invoice Subform" is extended and another repeater is added for purchase lines:

Issue was recreated using Cronus database BC27.5 and following extension was deployed:

pageextension 50100 "Purch. Invoice Sub. Ext." extends "Purch. Invoice Subform"
{
    layout
    {
        addafter(PurchDetailLine)
        {
            repeater(S4LAPurchDetailLine)
            {
                field(S4LAFilteredTypeField; TypeAsText)
                {
                    ApplicationArea = All;
                    Caption = 'Type';
                    LookupPageID = "Option Lookup List";
                    TableRelation = "Option Lookup Buffer"."Option Caption" where("Lookup Type" = const(Purchases));
                    ToolTip = 'Specifies the type of transaction that will be posted with the document line. If you select Comment, then you can enter any text in the Description field, such as a message to a customer. ';
                }
            }
        }
    }
    trigger OnAfterGetRecord()
    begin
        UpdateTypeText();
    end;

    trigger OnAfterGetCurrRecord()
    begin
        UpdateTypeText();
    end;

    var
        TempOptionLookupBuffer: Record "Option Lookup Buffer" temporary;
        TypeAsText: Text[30];

    local procedure UpdateTypeText()
    var
        RecRef: RecordRef;
    begin
        RecRef.GetTable(Rec);
        TypeAsText := TempOptionLookupBuffer.FormatOption(RecRef.Field(Rec.FieldNo(Type)));
    end;
}

Attached video with the situation.

BC.craches.mp4

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions