As mentioned in the previous section, there is a governor in place to restrict the number of Employee objects that can be returned on a single request. This number can be verified in the Authentication response in the MaximumQueryResults setting.
If your query is returning too many results, you can use the GetEmployeesByXRefCodesRequest to retrieve all of the employees that match your query criteria in batches by using groups of employee xref codes.
This alternative process involves determining the MaximumQueryResults limit enforced by the query governor. Next, you can run the GetEmployeeXRefCodesRequest to retrieve an unbounded number of employee xref codes. When you have the complete list of the xref codes of those employees that match your query, you can submit additional requests to retrieve the actual employee data using xref codes in groups (batches) no larger than the MaximumQueryResult limit.
Query for a Large Group of Employees
To query for a large group of employees:
- Verify the value of
MaximumQueryResultsin the authentication response. - Execute a query with a populated
GetEmployeeXRefCodesRequestobject. - Note: This object is very similar to the
GetEmployeesRequestobject. See Use the GetEmployeesRequest Object. - Take the
GetEmployeesRequestobject and group the xref codes into groups no larger than the maximum value obtained in step 1. - Instantiate a
GetEmployeesByXrefCodeRequestobject for each group of xref codes, and submit those objects one at a time to the Query method.