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