跳到主要内容

String 字段类型

这些字段类型使用 dataType: 'string'。

字段类型存储值
文本普通文本
长文本普通文本,通常是多行
辅助文本从建议中选取或自由输入的普通文本
流水号自动生成或手动填写的业务编码
搜索选中的目标记录 ID
外键指向另一个表单的关联 key
下拉选中的选项值
单选选中的选项值
部门部门 ID
组织组织 ID
成员成员 ID
邮箱邮箱地址文本
链接URL 文本

脚本需要区分普通文本、选项值或关联 ID 时,可以用 context.formSchema.field 读取具体 type。

const field = await context.formSchema.field({
formApiName: 'orders',
fieldApiName: 'customer',
});

if (field?.type === 'search') {
const customerRecordId = String(record.data.customer || '');
}