简体中文
fetch_data
约 312 字大约 1 分钟
2025-04-28
该方法允许您获取某条业务对象数据。
FxUI.objectApi.fetch_data(apiName:String, dataId:String) <Preview text="预览(当前浏览器需要登录纷享账号)" cmpName='fetchData'/>参数
| 参数 | 说明 | 类型 | 可选值 | 默认值 |
|---|---|---|---|---|
| apiName | 业务对象apiName(必填) | string | — | — |
| dataId | 业务对象数据id(必填) | string | — | — |
返回结果
| 参数 | 说明 | 类型 | 可选值 | 默认值 |
|---|---|---|---|---|
| key | 返回该对象字段的api_name | any | — | value |
| key是字段的api_name,value是字段对应的值。 |
代码示例
该方法返回一个 Promise对象,示例如下:
import FxUI from 'fxui-mobile';
FxUI.objectApi.fetch_data("object_lt6yx__c","64881f13e50a930001a5b941").then((res) => {
console.log('fetch_data 成功回调', res)
}).catch((err) => {
console.log('fetch_data 失败回调', err)
})注意
需要注意的是,有些类型的字段还有 __r 或者 __l等后缀的key来存储其他辅助信息,例如下面的owner字段,除了 owner 之外,还有 owner__r、owner__l。
{
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: "阿隆索离开的减肥啦",
picAddr: "",
email: "",
nickname: "阿隆索离开的减肥啦",
phone: "",
...
}],
owner__r: {
picAddr: "",
description: "",
dept: "1016",
supervisorId: null,
title: null,
...
},
owner_department: "PRM测试",
owner_department_id: "1016",
package: "CRM",
partner_id: null,
record_type: "default__c",
relevant_team: [{
teamMemberEmployee: ["1056"],
teamMemberRole: "1",
teamMemberPermissionType: "2"
}],
relevant_team__r: "阿隆索离开的减肥啦",
tenant_id: "590063",
version: "3",
_id: "5ee88fb29158b400017c31d8"
}