import { getBoEntities } from "@dvelop-sdk/business-objects";
const resultPage: GetBoEntitiesResultPage = await getBoEntities({
systemBaseUri: "https://sacred-heart-hospital.d-velop.cloud",
authSessionId: "3f3c428d452"
},{
modelName: "HOSPITALBASEDATA",
pluralEntityName: "employees"
});
let employees = resultPage.value;
// Use this for paging
let page = resultPage;
while (page.getNextPage) {
page = await page.getNextPage();
employees = employees.concat(page.value);
}
You can also use generics:
import { getBoEntities } from "@dvelop-sdk/business-objects";
interface Employee {
employeeId: string;
firstName: string;
lastName: string;
jobTitel: string;
}
const resultPage: GetBoEntitiesResultPage<Employee> = await getBoEntities<Employee>({
systemBaseUri: "https://sacred-heart-hospital.d-velop.cloud",
authSessionId: "3f3c428d452"
}, {
modelName: "HOSPITALBASEDATA",
pluralEntityName: "employees"
});
resultPage.value.forEach(e => console.log(e.lastName));
// Dorian
// Turk
Returns all specified entities from a model. This result might be partial due to the default page size.
You can navigate to the next pages using the function getNextPage. If the function is undefined, the page does not exist.
import { getBoEntities } from "@dvelop-sdk/business-objects";
const resultPage: GetBoEntitiesResultPage = await getBoEntities({
systemBaseUri: "https://sacred-heart-hospital.d-velop.cloud",
authSessionId: "3f3c428d452"
},{
modelName: "HOSPITALBASEDATA",
pluralEntityName: "employees"
});
let employees = resultPage.value;
// Use this for paging
let page = resultPage;
while (page.getNextPage) {
page = await page.getNextPage();
employees = employees.concat(page.value);
}
You can also use generics:
import { getBoEntities } from "@dvelop-sdk/business-objects";
interface Employee {
employeeId: string;
firstName: string;
lastName: string;
jobTitel: string;
}
const resultPage: GetBoEntitiesResultPage<Employee> = await getBoEntities<Employee>({
systemBaseUri: "https://sacred-heart-hospital.d-velop.cloud",
authSessionId: "3f3c428d452"
}, {
modelName: "HOSPITALBASEDATA",
pluralEntityName: "employees"
});
resultPage.value.forEach(e => console.log(e.lastName));
// Dorian
// Turk
Returns all specified entities from a model. This result might be partial due to the default page size. You can navigate to the next pages using the function
getNextPage. If the function is undefined, the page does not exist.