ebs.getByIdAsync
(FintechOS Studio 20.2 and later)
Asynchronously returns detailed information about a specific record based on its ID and the entity name. The result of the operation is returned in a promise object.
Syntax
Copy
ebs.getById(entityName: string, recordId: string).then(promise: any);
| Parameter | Description |
|---|---|
entity_name
|
The name of the entity for which you want to get specific metadata. |
recordId
|
Unique internal identifier of the record. |
promise
|
An object representing the eventual completion or failure of an asynchronous operation. |
Result
The promise result is a JSON object containing key-value pairs containing the record of the entity specified in the request.
Examples
In this example:
- We have an entity with the name myEntity name.
- On this entity there is a record with the ID recordGuid.
- We want to get the attributes' name and value for the specified record ID..
Copy
ebs.getByIdAsync("myEntity", "{recordGuid}")
.then(function(record) {
if (record && record["attributeName"]) {
var attributeValue = record["attributeName"];
}
})
.catch(function(err) {
console.log(err);
});
The promise returns the record with the ID recordGuid.