Class CustomField

ช่องที่กำหนดเอง

เลิกใช้งานแล้ว แต่ให้ใช้บริการขั้นสูงของ People API แทน

ช่องที่กำหนดเองในรายชื่อติดต่อ

เมธอด

วิธีการประเภทการแสดงผลรายละเอียดแบบย่อ
getLabel()Objectรับป้ายกำกับของช่องนี้
setLabel(label)CustomFieldตั้งค่าป้ายกํากับของช่องนี้

เอกสารประกอบโดยละเอียด

getLabel()

รับป้ายกำกับของช่องนี้ ซึ่งอาจเป็นฟิลด์ ExtendedField หรือสตริง

// 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.
const contacts = ContactsApp.getContactsByName('John Doe');
const addressFields = contacts[0].getAddresses();
for (let i = 0; i < addressFields.length; i++) {
  Logger.log(addressFields[i].getLabel());
}

รีเทิร์น

Object — ป้ายกำกับของช่องนี้

การให้สิทธิ์

สคริปต์ที่ใช้วิธีการนี้ต้องได้รับอนุญาตด้วยขอบเขตต่อไปนี้อย่างน้อย 1 รายการ

  • 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.
const contacts = ContactsApp.getContactsByName('John Doe');
const addressFields = contacts[0].getAddresses();
addressFields[0].setLabel('Apartment');

พารามิเตอร์

ชื่อประเภทคำอธิบาย
labelStringป้ายกำกับใหม่สำหรับช่องนี้

รีเทิร์น

CustomField — ช่องนี้มีประโยชน์สำหรับการต่อเชื่อม

การให้สิทธิ์

สคริปต์ที่ใช้วิธีการนี้ต้องได้รับอนุญาตด้วยขอบเขตต่อไปนี้อย่างน้อย 1 รายการ

  • https://www.google.com/m8/feeds

วิธีการที่เลิกใช้งาน