Export (0) Print
Expand All

FINDLAST Function (Record)

Microsoft Dynamics Nav 2009

Finds the last record in a table based on the current key and filter.


[Ok :=] Record.FINDLAST

Parameters

Record

Type: Record

If the record was found, it is returned in this parameter and any FlowFields in the record are set to zero. You must update the FlowFields by using the CALCFIELDS Function (Record).

If the record was not found and if you omitted the return value, a run-time error occurs.

Type: Boolean

true if the record was found; otherwise, false.

If you omit this optional return value and the record cannot be found, a run-time error occurs. If you include a return value, you must handle any errors.

This function should be used instead of FIND('+') when you only need the last record.

You should only use this function when you explicitly want to find the last record in a table/set. Do not use this function in combination with REPEAT..UNTIL.

This example requires that you create a Record variable named GLEntryRec for the G/L Entry table.

// Read the last record only. 
IF GLEntryRec.FINDLAST THEN
  …

Community Additions

ADD
Show:
© 2014 Microsoft