Using "COUNT" for total - Navision

Hi Everybody,

Can you help me on how to use the “count” method in Navision.

This is for displaying number of records in the reports.

Thank You,

Ron

COUNT, will tell you the number of records in a dataitem (on which various filters are applied). Online help describes it as follows and it is quite explanatory:

COUNT (Record)

Use this function to count the number of records in a C/SIDE table.

Number := Record.COUNT

Record

Data type: record

Refers to the table to be counted.

Number

Data type: integer

The number of records in the table.

Comments

This function returns the number of records that meet the conditions of any filters associated with the records. If no filters are set, the function tells you the total number of records in the table.

Example

This example shows how to use the COUNT function. The statement:

Number := Customer.COUNT;

assigns the number of records in the Customer table to the Number variable. This statement is the same as:

Number := 0;
IF Customer.FIND(’-’) THEN
REPEAT
Number := Number + 1;
UNTIL Customer.NEXT = 0;

except the first example is much faster since only one command to the Database Management System (DBMS) is needed. The second example sends several commands to the DBMS

This example shows how to use the COUNT function.

Number := Customer.COUNT;
// This statement assigns the number of records in the Customer table
// to the Number variable. This statement is the same as:
Number := 0;
IF Customer.FIND('-') THEN
REPEAT
Number := Number + 1;
UNTIL Customer.NEXT = 0;

Retrieving the count by using the first statement in the example is much faster because only one command to the Database Management System (DMBS) is needed.

Hi Ronnel,

Did you ever find a solution to your problem? If you did, would you mind sharing it with us and if any of the posted answers helped you on the way, then please verify them.

Thank you.

Hi,

I want no of invoices for each customer can anybody help how to use count for this…

Regards,

venkatesh