Type for Entity. Defaults to any.
import { getBoEntity } from "@dvelop-sdk/business-objects";
const jd = await getBoEntity({
systemBaseUri: "https://sacred-heart-hospital.d-velop.cloud",
authSessionId: "3f3c428d452"
},{
modelName: "HOSPITALBASEDATA",
pluralEntityName: "employees",
keyPropertyType: "string", //"string", "number" or "guid"
keyPropertyValue: "1"
});
console.log(jd); // { employeeId: '1', firstName: 'John Micheal', lastName: 'Dorian', jobTitel: 'senior physician' }
You can also use generics:
import { getBoEntity } from "@dvelop-sdk/business-objects";
interface Employee {
employeeId: string;
firstName: string;
lastName: string;
jobTitel: string;
}
const jd: Employee = await getBoEntity<Employee>({
systemBaseUri: "https://sacred-heart-hospital.d-velop.cloud",
authSessionId: "3f3c428d452"
},{
modelName: "HOSPITALBASEDATA",
pluralEntityName: "employees",
keyPropertyType: "string", //"string", "number" or "guid"
keyPropertyValue: "1"
});
console.log(jd.lastName); // Dorian
Returns one specified entity from a model.
import { getBoEntity } from "@dvelop-sdk/business-objects";
const jd = await getBoEntity({
systemBaseUri: "https://sacred-heart-hospital.d-velop.cloud",
authSessionId: "3f3c428d452"
},{
modelName: "HOSPITALBASEDATA",
pluralEntityName: "employees",
keyPropertyType: "string", //"string", "number" or "guid"
keyPropertyValue: "1"
});
console.log(jd); // { employeeId: '1', firstName: 'John Micheal', lastName: 'Dorian', jobTitel: 'senior physician' }
You can also use generics:
import { getBoEntity } from "@dvelop-sdk/business-objects";
interface Employee {
employeeId: string;
firstName: string;
lastName: string;
jobTitel: string;
}
const jd: Employee = await getBoEntity<Employee>({
systemBaseUri: "https://sacred-heart-hospital.d-velop.cloud",
authSessionId: "3f3c428d452"
},{
modelName: "HOSPITALBASEDATA",
pluralEntityName: "employees",
keyPropertyType: "string", //"string", "number" or "guid"
keyPropertyValue: "1"
});
console.log(jd.lastName); // Dorian
Returns one specified entity from a model.