Counting lines in a table

MasterOfDragons
MasterOfDragons Member Posts: 18
Hi,

I'm writing a report and have to determine the number of lines in a table before doing anything else. How could I do this?

Thanks inadvance
Master of Dragons

Answers

  • DenSter
    DenSter Member Posts: 8,307
  • MasterOfDragons
    MasterOfDragons Member Posts: 18
    Thanks for the fast answer; but could you please be a bit more specific, as I'm quite new to Navision and C/AL? :?

    Master of Dragons

    EDIT: Never mind, I think I've found what I need. Thanks.
  • kine
    kine Member Posts: 12,562
     CountOfLines := Rec.Count;
    

    CountOfLines is the Integer variable which will be used to store the no. of lines in the table.

    Rec is variable of type Record for your table with applied all filters you need.

    Rec.Count is function, which will count the records which are accessible with given filters.

    Never mind: I read that you found the answer after I answered... :-)
    Kamil Sacek
    MVP - Dynamics NAV
    My BLOG
    NAVERTICA a.s.