Matrix - how to read it

cCodecCode Member Posts: 6
If you have an existing Matrix in a form, how you can read a specific column or all columns.

Let's say there is a Matrix with 10 rows and 5 columns, matrix is already populated and values are decimals. If I want to read value of row 4 column 3 with C/AL code, how to do it?

Comments

  • MalajloMalajlo Member Posts: 294
    Only using filters and calcfields.
    I.e.:
    row.findfirst ; //if findfirst then else...
    if row.count >= NoOfRow then  
      repeat 
        i := i + 1 ;
      until i = NoOfRow ;
    
    i := 0 ;
    column.findfirst ;
    if column.count >= NoOfColumn then  
      repeat
        i := i + 1 ;
      until i = NoOfColumn ;
    row.setfilter...
    row.calcfields(xxx) ;
    exit(row.xxx) ;
    
  • kinekine Member Posts: 12,562
    Do not forget that some Matrixes can have "unlimited" columns (e.g. date table etc.)
    Kamil Sacek
    MVP - Dynamics NAV
    My BLOG
    NAVERTICA a.s.
Sign In or Register to comment.