English
fetch_data
About 189 wordsLess than 1 minute
2025-12-16
This method allows you to get a business object record.
Syntax: FxUI.objectApi.fetch_data(apiName, dataId)
Parameters
| Parameter | Description | Type | Allowed Values | Default |
|---|---|---|---|---|
| apiName | Business object apiName (required) | string | — | — |
| dataId | Business object record ID (required) | string | — | — |
Example
This method returns a Promise, as shown below:
FxUI.objectApi.fetch_data('AccountObj', '5ee83f974ddcee0001faa57d').then((data) => {
console.log(data);
// todo what you want
}).catch(err => {
console.log(err);
})Return Value
The key is the field api_name, and the value is the corresponding field value.
Note that some field types also include keys with suffixes such as __r or __l to store additional helper information. For example, in the owner field below, there are owner__r and owner__l in addition to owner.
{
field_2l23J__c: null,
field_2t8Oo__c: null,
field_59N45__c: [],
field_AJvu7__c: null,
field_F99W2__c: null,
field_Gakhc__c: null,
field_Lnl21__c: null,
field_cy6J2__c: null,
owner: ["1056"],
owner__l: [{
id: "1056",
tenantId: "590063",
name: "Example Employee",
picAddr: "",
email: "",
nickname: "Example Employee",
phone: "",
...
}],
owner__r: {
picAddr: "",
description: "",
dept: "1016",
supervisorId: null,
title: null,
...
},
owner_department: "PRM Test",
owner_department_id: "1016",
package: "CRM",
partner_id: null,
record_type: "default__c",
relevant_team: [{
teamMemberEmployee: ["1056"],
teamMemberRole: "1",
teamMemberPermissionType: "2"
}],
relevant_team__r: "Example Employee",
tenant_id: "590063",
version: "3",
_id: "5ee88fb29158b400017c31d8"
}