Class PhoneField

PhoneField

Không dùng nữa. Thay vào đó, hãy sử dụng dịch vụ nâng cao về API Mọi người

Trường số điện thoại trong một Danh bạ.

Phương thức

Phương thứcKiểu dữ liệu trả vềMô tả ngắn
getLabel()ObjectLấy nhãn cho trường này.
isPrimary()BooleanLấy xem đây có phải là giá trị của trường chính hay không.
setAsPrimary()PhoneFieldĐặt trường này thành trường chính.
setLabel(field)PhoneFieldĐặt nhãn cho trường này.
setLabel(label)PhoneFieldĐặt nhãn cho trường này.

Tài liệu chi tiết

getLabel()

Lấy nhãn cho trường này. Đây có thể là một Trường, ExtendedField hoặc một Chuỗi.

// 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());
}

Cầu thủ trả bóng

Object – nhãn của trường này

Ủy quyền

Tập lệnh sử dụng phương thức này cần được uỷ quyền với một hoặc nhiều phạm vi sau:

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

isPrimary()

Lấy xem đây có phải là giá trị của trường chính hay không.

// Logs whether or not the first address field associated with contact
// 'John Doe' is labeled as primary. This method can be similarly called
// for any field.
var contacts = ContactsApp.getContactsByName('John Doe');
var addressFields = contacts[0].getAddresses();
Logger.log(addressFields[0].isPrimary());

Cầu thủ trả bóng

Boolean — cho dù đây là địa điểm chính

Ủy quyền

Tập lệnh sử dụng phương thức này cần được uỷ quyền với một hoặc nhiều phạm vi sau:

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

setAsPrimary()

Đặt trường này thành trường chính.

// Sets the the first address field associated with contact 'John Doe'
// as primary. This method can be similarly called for any field.
var contacts = ContactsApp.getContactsByName('John Doe');
var addressFields = contacts[0].getAddresses();
addressFields[0].setAsPrimary();

Cầu thủ trả bóng

PhoneField — FieldValue này để tạo chuỗi

Ủy quyền

Tập lệnh sử dụng phương thức này cần được uỷ quyền với một hoặc nhiều phạm vi sau:

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

setLabel(field)

Đặt nhãn cho trường này.

// Sets the label to 'Work' 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(ContactsApp.Field.WORK_ADDRESS);

Các tham số

TênLoạiNội dung mô tả
fieldFieldnhãn chuẩn mới

Cầu thủ trả bóng

PhoneField — FieldValue này để tạo chuỗi

Ủy quyền

Tập lệnh sử dụng phương thức này cần được uỷ quyền với một hoặc nhiều phạm vi sau:

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

setLabel(label)

Đặt nhãn cho trường này.

// 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');

Các tham số

TênLoạiNội dung mô tả
labelStringnhãn mới cho trường này

Cầu thủ trả bóng

PhoneField — trường này, hữu ích cho việc tạo chuỗi

Ủy quyền

Tập lệnh sử dụng phương thức này cần được uỷ quyền với một hoặc nhiều phạm vi sau:

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

Các phương thức ngừng hoạt động