方法
方法 | 返回类型 | 简介 |
---|---|---|
getLabel() | Object | 获取此字段的标签。 |
setLabel(label) |
| 设置此字段的标签。 |
详细文档
getLabel()
获取此字段的标签。它可以是 Field、ExtendedField 或 String。
// Logs the label for all the address fields associated with contact // 'John Doe'. This method can be similarly called for any field that has // a label. var contacts = ContactsApp.getContactsByName('John Doe'); var addressFields = contacts[0].getAddresses(); for (var i = 0; i < addressFields.length; i++) { Logger.log(addressFields[i].getLabel()); }
弃踢回攻
Object
- 此字段的标签
授权
使用此方法的脚本需要获得以下一个或多个范围的授权:
-
https://www.google.com/m8/feeds
setLabel(label)
设置此字段的标签。
// Sets the label to 'Apartment' for the first address field associated // with contact 'John Doe'. This method can be similarly called for any // field that has a label. var contacts = ContactsApp.getContactsByName('John Doe'); var addressFields = contacts[0].getAddresses(); addressFields[0].setLabel('Apartment');
参数
名称 | 类型 | 说明 |
---|---|---|
label | String | 此字段的新标签 |
弃踢回攻
- 此字段,可用于链接DateField
授权
使用此方法的脚本需要获得以下一个或多个范围的授权:
-
https://www.google.com/m8/feeds