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

类型

AutomationField.Type(属性)

说明

可读写

自动任务字段的类型,有三种类型,参考枚举值 DbAutomationPresetType ,分别为CheckedNotifyContact,UpdatedNotifyContact,DueDateNotifyContact

返回值

String

浏览器环境示例

javascript
async function example() {
    await instance.ready();
    const Application = instance.Application;
    const contactField = await Application.FieldDescriptor("Contact","联系人字段")
    await Application.Sheets(1).FieldDescriptors.AddField(contactField)
    const dateField = await Application.FieldDescriptor("Date","日期字段")
    await Application.Sheets(1).FieldDescriptors.AddField(dateField)
    const newField = await Application.FieldDescriptor("Automations","自动任务字段")
    const automation = await newField.Automation
    automation.Type = "DueDateNotifyContact"
    automation.TriggerField = await dateField.Id
    automation.ContactField = await contactField.Id
    automation.ExecuteTime = 3600
    await Application.Sheets(1).FieldDescriptors.AddField(newField)
}

脚本编辑器 示例

javascript
function main() {
    const contactField = FieldDescriptor("Contact","联系人字段")
    Sheets(1).FieldDescriptors.AddField(contactField)
    const dateField = FieldDescriptor("Date","日期字段")
    Sheets(1).FieldDescriptors.AddField(dateField)
    const newField = FieldDescriptor("Automations","自动任务字段")
    const automation = newField.Automation
    automation.Type = "DueDateNotifyContact"
    automation.TriggerField = dateField.Id
    automation.ContactField = contactField.Id
    automation.ExecuteTime = 3600
    Sheets(1).FieldDescriptors.AddField(newField)
}
main();
回到旧版