Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics NAV (Archived)

Read data from Matrix Page

Posted on by 2,983

We've created a custom Matrix Page in NAV 2017. The Page basically shows some row and column labels, as any matrix page, and the user can input values in the Data Cells (MATRIX_CellData[1],MATRIX_CellData[2], etc)

The idea is to have some code in OnClosePage() trigger, to read the data from the Matrix Page and store it in a NAV Table.

We are not able to find code to set the cursor position on the first row, and retrieve the MATRIX_CellData values. Then loop to the next row and so on, until all rows have been read.

Any ideas? This is what we have tried, but it's always returning the data in the actual Page's active row

IF FINDFIRST THEN REPEAT 
 MESSAGE(FORMAT(MATRIX_CellData[1]));
UNTIL NEXT=0;

The only solution I've found is to code the OnValidate trigger of each MATRIX_CellData field, and store the values on a Temporary record. Then in the OnClosePage() trigger, I will loop through this temp. record and store the values. It's sad to have to do this, as the values are already on screen, and must be some way to just read them

*This post is locked for comments

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

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,280 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,235 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans