web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Small and medium business | Business Central, N...
Unanswered

Worksheet page fields of matrix[1] ....are not getting updated

(2) ShareShare
ReportReport
Posted on by 234
I have a requirement where a worksheet page with a listplus needs to be populated on basis of year selected on headers. Say , we have mentioned 2024 as start and 2034 as end then, boolean data in listplus should get populated on basis of year selected as tue and false but it is not geeting updated.

If i use OnaftergetRecord on listplus then only it is getting updated but i want to call Onaftergetrecord once filter is selected on worksheet page but this approach is not working.
 field(Period; Period)
                {
                    ToolTip = 'Specifies the value of the period field.';
                    Caption = 'Period';
 
                    trigger OnValidate()
                    var
                        LeaseInfoRec: Record /ADT-Lease Information/;
                        MATRIX_CurrentColumnOrdinal: Integer;
                        avaliablitymatrixpage: Page /Avaliablity Matrix/;
                    begin
                        if LeaseInfoRec.FindSet() then
                            repeat
                                for MATRIX_CurrentColumnOrdinal := 1 to 12 do begin
                                    avaliablitymatrixpage.UpdateData(Period, MATRIX_CurrentColumnOrdinal, LeaseInfoRec);
                                end;
 
                            until LeaseInfoRec.Next() = 0;
                    end;
 
                }

    procedure UpdateData(Period: Enum /Day Filter/; ColumnID: Integer; LeaseInfoRec: Record /ADT-Lease Information/)
    var
        TempItem: Record /ADT-Lease Information/ temporary;
        Startdate: Date;
        Enddate: Date;
        NewCaption: Text[80];
        CaptionDate: Date;
        Month: Integer;
        Year: Integer;
        StartMonth: Integer;
        EndMonth: Integer;
        StartYear: Integer;
        EndYear: Integer;
    begin
 
        rec.get(LeaseInfoRec.Number);      
        TempItem.Copy(rec);
 
        Startdate := TempItem.LeaseCommencementDate;
        Enddate := TempItem.LeaseCommencementEndDate;
 
        StartMonth := Date2DMY(Startdate, 2);
        EndMonth := Date2DMY(Enddate, 2);
        StartYear := Date2DMY(Startdate, 3);
        EndYear := Date2DMY(Enddate, 3);
 
        case Period of
            Period::Day:
                begin
                    // Handle Day calculations
                end;
            Period::Month:
                begin
                    Month := ColumnID; // Set the month based on the ColumnID
                    Year := 2024; // Set the year to 2024
                    NewCaption := Format(DMY2Date(1, Month, Year), 0, '<Month,2>/<Year4>');
                    CaptionDate := DMY2Date(1, Month, Year);
                end;
            Period::Year:
                begin
                    Year := Date2DMY(TempItem.LeaseCommencementDate, 3) + ColumnID - 1;
                    NewCaption := Format(DMY2Date(1, 1, Year), 0, '<Year4>');
                    CaptionDate := DMY2Date(1, 1, Year);
                end;
        end;
 
        MATRIX_CaptionSet[ColumnID] := NewCaption;
 
        if (Startdate <= CaptionDate) and (CaptionDate <= Enddate) then
            MATRIX_CellData[ColumnID] := true
        else
            MATRIX_CellData[ColumnID] := false;
 
        Rec.Modify();
        CurrPage.Update();
    end;
I have the same question (0)

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Meet the Microsoft Dynamics 365 Contact Center Champions

We are thrilled to have these Champions in our Community!

Congratulations to the March Top 10 Community Leaders

These are the community rock stars!

Leaderboard > Small and medium business | Business Central, NAV, RMS

#1
OussamaSabbouh Profile Picture

OussamaSabbouh 1,922 Super User 2026 Season 1

#2
YUN ZHU Profile Picture

YUN ZHU 1,078 Super User 2026 Season 1

#3
Khushbu Rajvi. Profile Picture

Khushbu Rajvi. 628 Super User 2026 Season 1

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans