Processing a Paginated List of Case References

When a paginated list of case references is returned by a method on a case access class or case reference, the list object has a hasMoreResults attribute that can be used to determine whether there are more pages of results that could be returned.

Paginated lists can be returned by the following case access class methods:

and by the following case reference methods:

  • getassociationNameRefs()
  • navigateByCriteriaToassociationNameRefs()

Example

This example shows how to use a paginated list to iterate through a returned list of customers.

	var maxOrderCount = 0;
	var name = "";
	var index = 0;
	var pageSize = 100;

	while (true) {
		var custRefs = cac_com_example_ordermodel_Customer.findAll(index, pageSize);
		for (var ix = 0; ix < custRefs.size(); ix++) {

				// Process the case reference...

			}
		}
		if (custRefs.hasMoreResults) {
			index += pageSize;
		} else {
			break;
		}
	}