Description
Returns the number of records found when a query on service requests by providing a ServiceRequest object which contain parameters to filter the results by the place of supply and/or the status.
Package Details
Interface
IServiceRequestManager
Syntax
Task<int> ExecuteCountQuery(ServiceRequestQuery serviceRequestQuery)
Returns
Task<int>
API Endpoint
Not applicable.
Examples
Note:
ServiceRequestQuery details are at the bottom of the page.
Example - Filtering by place of supply and status
//This is an exemple of a query using filtering for the place of supply and status. //This will filter all service requests for service id 11. const ServiceRequestStatus status = ServiceRequestStatus.InProgress; const string province = "ON"; var query = new ServiceRequestQuery { ServiceId = ServiceId, Page = 1, PageSize = 25, Version = 1.0F, Filter = $"PlaceOfSupply='{province}' AND Status='{status}'" }; var count = await serviceRequestManager.ExecuteCountQuery(query);
Example - Filtering by place of supply only
//This is an exemple of a query using filtering for the place of supply and status. //This will filter all service requests for service id 11. const string province = "ON"; var query = new ServiceRequestQuery { ServiceId = ServiceId, Page = 1, PageSize = 25, Version = 1.0F, Filter = $"PlaceOfSupply='{province}'" }; var count = await serviceRequestManager.ExecuteCountQuery(query);
Example - Filtering by service request status
//This is an exemple of a query using filtering for the place of supply and status. //This will filter all service requests for service id 11. const ServiceRequestStatus status = ServiceRequestStatus.InProgress; var query = new ServiceRequestQuery { ServiceId = ServiceId, Page = 1, PageSize = 25, Version = 1.0F, Filter = $"Status='{status}'" }; var count = await serviceRequestManager.ExecuteCountQuery(query);
ServiceRequestQuery
Name | Type | Description |
UserId | Integer | User id associated to service request. Default value is 0. |
ServiceId | Integer | Service id associated to service request. Default value is 0. |
OrganizationId | Integer | Organization id associated to service request. Default is 0. |
ExcludeMetadata | Boolean | True to include the service request meta data be included in the result. False to exclude the service request meta data be included in the result. |
Page | Integer | The page number. If the value provided is 0 then it will default to 1. |
PageSize | Integer | The page size. If the value provided is 0 then it will default to 25. |
Filter | String | This is used to filter the results by place of supply and/or status. Note: Place of supply Note: Possible values:
Status Note: Possible values for service request statuses.
Place of supply and status Example: |
Version | Number | Filter version number. Value should be set to 1. This is currently only used for logging purposes. |