已淘汰的方法
方法 | 傳回類型 | 簡短說明 |
---|---|---|
| void | 刪除這個公司欄位。 |
| String | 取得公司名稱。 |
| String | 取得職稱。 |
| Boolean | 取得是否為主要公司。 |
|
| 將這個公司設為主要公司,並取消設定先前的主要公司。 |
|
| 設定公司名稱。 |
|
| 設定職稱。 |
已淘汰的方法
delete Company Field()
delete Company Field()
已淘汰。這個函式已淘汰,不建議在新指令碼中使用。
刪除這個公司欄位。
// Deletes the first company associated with contact 'John Doe' const contacts = ContactsApp.getContactsByName('John Doe'); const company = contacts[0].getCompanies()[0]; company.deleteCompanyField();
授權
使用這個方法的腳本需要具備下列一或多個範圍的授權:
-
https://www.google.com/m8/feeds
get Company Name()
get Company Name()
已淘汰。這個函式已淘汰,不建議在新指令碼中使用。
取得公司名稱。
// Logs company name for all companies associated with contact 'John Doe' const contacts = ContactsApp.getContactsByName('John Doe'); const companies = contacts[0].getCompanies(); for (const i in companies) { Logger.log(companies[i].getCompanyName()); }
回攻員
String
- 公司名稱
授權
使用這個方法的腳本需要具備下列一或多個範圍的授權:
-
https://www.google.com/m8/feeds
get Job Title()
get Job Title()
已淘汰。這個函式已淘汰,不建議在新指令碼中使用。
取得職稱。
// Logs job title for all companies associated with contact 'John Doe' const contacts = ContactsApp.getContactsByName('John Doe'); const companies = contacts[0].getCompanies(); for (const i in companies) { Logger.log(companies[i].getJobTitle()); }
回攻員
String
- 職稱
授權
使用這個方法的腳本需要具備下列一或多個範圍的授權:
-
https://www.google.com/m8/feeds
is Primary()
is Primary()
已淘汰。這個函式已淘汰,不建議在新指令碼中使用。
取得這是主要公司。
// Logs true or false depending on whether each company is the primary // company for contact 'John Doe' const contacts = ContactsApp.getContactsByName('John Doe'); const companies = contacts[0].getCompanies(); for (const i in companies) { Logger.log(companies[i].isPrimary()); }
回攻員
Boolean
:是否為主要
授權
使用這個方法的腳本需要具備下列一或多個範圍的授權:
-
https://www.google.com/m8/feeds
set As Primary()
set As Primary()
已淘汰。這個函式已淘汰,不建議在新指令碼中使用。
將這個公司設為主要公司,並取消先前主要公司的設定。
// Sets the first company associated with contact 'John Doe' as primary const contacts = ContactsApp.getContactsByName('John Doe'); const company = contacts[0].getCompanies()[0]; company.setAsPrimary();
回攻員
:這個公司欄位,可用於鏈結Company
授權
使用這個方法的腳本需要具備下列一或多個範圍的授權:
-
https://www.google.com/m8/feeds
set Company Name(company)
set Company Name(company)
已淘汰。這個函式已淘汰,不建議在新指令碼中使用。
設定公司名稱。
// Sets the company name for the first company associated with contact 'John // Doe' const contacts = ContactsApp.getContactsByName('John Doe'); const company = contacts[0].getCompanies()[0]; company.setCompanyName('ACME Corp');
參數
名稱 | 類型 | 說明 |
---|---|---|
company | String | 公司的新名稱 |
回攻員
:這個公司欄位,可用於鏈結Company
授權
使用這個方法的腳本需要具備下列一或多個範圍的授權:
-
https://www.google.com/m8/feeds
set Job Title(title)
set Job Title(title)
已淘汰。這個函式已淘汰,不建議在新指令碼中使用。
設定職稱。
// Sets the job title for the first company associated with contact 'John Doe' const contacts = ContactsApp.getContactsByName('John Doe'); const company = contacts[0].getCompanies()[0]; company.setJobTitle('Manager');
參數
名稱 | 類型 | 說明 |
---|---|---|
title | String | 聯絡人在該公司的新職稱 |
回攻員
:這個公司欄位,可用於鏈結Company
授權
使用這個方法的腳本需要具備下列一或多個範圍的授權:
-
https://www.google.com/m8/feeds