AutoLinkGroups (对象)
说明
关联字段的关系组集合,如果有多个关系组,则这些关系组是或的关系
方法
属性
浏览器环境示例
javascript
async function example() {
await instance.ready();
const Application = instance.Application;
const sheet = Application.Sheets(1)
const linkField = await sheet.FieldDescriptors(3)
const linkGroups = await Application.AutoLinkGroups()
const group = linkGroups.Add()
const conditions = group.Conditions
const fieldId = sheet.FieldId("状态")
conditions.Add(fieldId, [fieldId], "Field", "Equals")
linkField.AutoLinkGroups = linkGroups
linkField.IsAutoLink = true
linkField.Apply()
}
脚本编辑器 示例
javascript
function main(){
const sheet = Application.Sheets(1)
const linkField = sheet.FieldDescriptors(3)
const linkGroups = Application.AutoLinkGroups()
const group = linkGroups.Add()
const conditions = group.Conditions
const fieldId = sheet.FieldId("状态")
const condition = conditions.Add(fieldId, [fieldId], "Field", "Equals")
linkField.AutoLinkGroups = linkGroups
linkField.IsAutoLink = true
const result = linkField.Apply()
console.log("####", result)
}
main()