SysGetEntityPage
Retrieves first page of custom entities from the server based on the custom entity type and specified query context. Bypasses ownership/ACL checks.
Note that for collections with > 1,000 records, it is recommended that doCount
be set to false for better performance.
Example context object:
{
"pagination": {
"rowsPerPage": 50,
"pageNumber": 1,
"doCount": false
},
"searchCriteria": {
"data.position": "defense"
},
"sortCriteria": {
}
}
Service | Operation |
---|---|
customEntity | SYS_GET_ENTITY_PAGE |
Method Parameters
Parameter | Description |
---|---|
entityType | The type of custom entity being retrieved. |
context | A context object describing the desired paging behaviour |
Usage
http://localhost:3000
- C#
- C++
- Objective-C
- Java
- JavaScript
- Dart
- Cloud Code
- Raw
// Cloud Code only. To view example, switch to the Cloud Code tab
// Cloud Code only. To view example, switch to the Cloud Code tab
// Cloud Code only. To view example, switch to the Cloud Code tab
// Cloud Code only. To view example, switch to the Cloud Code tab
// Cloud Code only. To view example, switch to the Cloud Code tab
// Cloud Code only. To view example, switch to the Cloud Code tab
var entityType = "athletes";
var context = {
"pagination": {
"rowsPerPage": 50,
"pageNumber": 1,
"doCount": false
},
"searchCriteria": {
"data.position": "defense"
},
"sortCriteria": {
}
};
var customEntityProxy = bridge.getCustomEntityServiceProxy();
var postResult = customEntityProxy.sysGetEntityPage(entityType, context);
if (postResult.status == 200) {
// Success!
}
{
"service": "customEntity",
"operation": "SYS_GET_ENTITY_PAGE",
"data": {
"entityType": "athletes",
"context": {
"pagination": {
"rowsPerPage": 50,
"pageNumber": 1
},
"searchCriteria": {
"data.position": "defense"
},
"sortCriteria": {
"createdAt": 1,
"updatedAt": -1
}
}
}
}
JSON Response
{
"status": 200,
"data": {
"_serverTime": 1637946319239,
"context": "eyJzZWFyY2hDcml0ZXJpYS...",
"results": {
"count": 1,
"page": 1,
"items": [
{
"entityId": "1497cc7e-66cb-4682-9eac-c755523369a8",
"version": 3,
"acl": {
"other": 1
},
"ownerId": null,
"expiresAt": null,
"timeToLive": null,
"createdAt": 1573540122600,
"updatedAt": 1573540445332,
"data": {
"firstName": "Super",
"surName": "Star",
"position": "defense",
"goals": 3,
"assists": 5
}
}
],
"moreAfter": false,
"moreBefore": false
}
}
}