Skip to content
开发文档
能力中心
应用市场
WebOffice
开发者后台

关联表格ID

FieldDescriptor.LinkSheet(属性)

说明

可读写

设置或读取单向关联或双向关联字段的关联表格的Id

返回值

Number

浏览器环境示例

javascript
async function example() {
    await instance.ready();
    // 插入单向关联字段
    const Application = instance.Application
    const sheet = await Application.Sheets(1)
    const linkField = await Application.FieldDescriptor("OneWayLink","单向关联")
    const prop = await linkField.Link
    prop.LinkSheet = await sheet.StId
    prop.IsAutoLink = false
    sheet.FieldDescriptors.AddField(linkField)
}

脚本编辑器 示例

javascript
function main() {
    const sheet = Application.Sheets(1)
    const linkField = Application.FieldDescriptor("OneWayLink","单向关联")
    const prop = linkField.Link
    prop.LinkSheet = sheet.StId
    prop.IsAutoLink = false
    sheet.FieldDescriptors.AddField(linkField)
}
main()
回到旧版