JavaScript object: SCRecordList

The following JavaScript object is unique to HPE Service Manager.

SCRecordList is an array of Datums that qualify with the query.

Constructor

new SCRecordList( <table name>, <QueryCond object>);

Arguments

The following arguments are valid for this object:

Argument Data type Description
table name String The name of the Service Manager table. For example, probsummary.
QueryCond object Service Manager JavaScript object QueryCond which defines the SC query to be executed.

Properties

None.

Methods

The following methods are valid for this object:

Defined method Description
getCount() This method returns the total number of records in the SCRecordList.
getPosition() This method returns the last position in the record list that has been accessed. .

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." );
}