ftos.data.loadExtension
Returns an entity extension's virtual attributes for a given entity record.
IMPORTANT!
Does not work for custom data extensions.
Does not work for custom data extensions.
Syntax
Copy
ftos.data.loadExtension(entityName: string, extensionName: string, viewName: string, recordId: string): any
| Property | Type | Description |
|---|---|---|
entityName
|
string | Name of the entity extension's parent entity. |
extentionName
|
string | Name of the entity extension. |
viewName(optional)
|
string | Name of the transient entity's view. To be used with entity extensions linked to transient data entities of type collection. |
recordId
|
string | Record ID for which the extension's attributes and values are retrieved. |
Return Value
Returns an object containing the entity extension's attribute names and their values. E.g.:
Copy
{
"firstName": "John",
"lastName": "Doe",
"email": "john.doe@example.com",
"phone": "+1-555-1234",
"isActive": true
}
Example
In this example, we retrieve the owner details of an account record currently opened in a form driven flow:
- The accounts entity stores the account data.
- Each account tracks its owner by referencing the account holders entity via a lookup attribute. This relationship is reflected in the accounts entity through the owner entity extension.
- We use the ftos.context.id property to retrieve the primary key of the current accounts record.
- We save the virtual attributes of the owner extension (i.e., the account holder' data) in the ownerData variable.
Copy
var ownerData = ftos.data.loadExtension('accounts', 'owner', ftos.context.id)