JavaScript method: SCRecordList.getPosition()

This method returns the position of the last accessed record in the record list. If there are no records are in the SCRecordList, it returns -1. If there is at least one record and it has not been accessed, the position is set to the first element, which is position 0.

Syntax

SCRecordList.getPosition();

Arguments

There are no arguments for this method.

Return values

Last position of Datum accessed in record list.

Returns -1 if there are no records in the list.

Returns 0 if list is not yet or the first Datum is the last Datum accessed and the list contains at least one record.

Example

This example does the following:

  • lists the location's position in a record list
  • counts the records in the list

This example requires the following sample data:

  • valid location(s)
  • valid record list with at least one record
var x = new SCRecordList( 'location', new QueryCond('location.name', LIKE, 'a'));

print("Total record in the list: " + x.getCount());

for (i in x ) {
  print(x[i].location_name + " is the " + x.getPosition() + " record in the record list." );
}