Class PhoneField

حقل الهاتف

تمّ إيقاف هذا العمود نهائيًا. بدلاً من ذلك، استخدِم خدمة People API المتقدمة.

حقل رقم هاتف في جهة اتصال

الطُرق

الطريقةنوع القيمة التي يتم عرضهاوصف قصير
getLabel()Objectتحصل على تصنيف هذا الحقل.
isPrimary()Booleanتحصل على ما إذا كانت هذه هي قيمة الحقل الأساسي.
setAsPrimary()PhoneFieldضبط هذا الحقل على "أساسي"
setLabel(field)PhoneFieldلضبط تصنيف هذا الحقل.
setLabel(label)PhoneFieldلضبط تصنيف هذا الحقل.
الطريقةنوع القيمة التي يتم عرضهاوصف قصير
deletePhoneField()voidلحذف حقل رقم الهاتف هذا.
getPhoneNumber()Stringاحصل على رقم الهاتف لهذا الحقل.
setPhoneNumber(number)PhoneFieldتُستخدَم لضبط رقم الهاتف لهذا الحقل.

مستندات تفصيلية

getLabel()

تحصل على تصنيف هذا الحقل. قد يكون هذا الحقل أو 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.
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: تصنيف هذا الحقل

التفويض

تتطلّب النصوص البرمجية التي تستخدِم هذه الطريقة الحصول على إذن واحد أو أكثر من النطاقات التالية:

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

isPrimary()

تحصل على ما إذا كانت هذه هي قيمة الحقل الأساسي.

// 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.
const contacts = ContactsApp.getContactsByName('John Doe');
const addressFields = contacts[0].getAddresses();
Logger.log(addressFields[0].isPrimary());

الإرجاع

Boolean - ما إذا كان هذا هو الحساب الأساسي

التفويض

تتطلّب النصوص البرمجية التي تستخدِم هذه الطريقة الحصول على إذن واحد أو أكثر من النطاقات التالية:

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

setAsPrimary()

ضبط هذا الحقل على "أساسي"

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

الإرجاع

PhoneField - حقل القيمة هذا للتسلسل

التفويض

تتطلّب النصوص البرمجية التي تستخدِم هذه الطريقة الحصول على إذن واحد أو أكثر من النطاقات التالية:

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

setLabel(field)

لضبط تصنيف هذا الحقل.

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

المعلمات

الاسمالنوعالوصف
fieldFieldالتصنيف العادي الجديد

الإرجاع

PhoneField - حقل القيمة هذا للتسلسل

التفويض

تتطلّب النصوص البرمجية التي تستخدِم هذه الطريقة الحصول على إذن واحد أو أكثر من النطاقات التالية:

  • 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التصنيف الجديد لهذا الحقل

الإرجاع

PhoneField: هذا الحقل مفيد لإنشاء سلاسل.

التفويض

تتطلّب النصوص البرمجية التي تستخدِم هذه الطريقة الحصول على إذن واحد أو أكثر من النطاقات التالية:

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

الطرق المتوقّفة

تمّ إيقاف هذا العمود نهائيًا. تم إيقاف هذه الدالة نهائيًا ويجب عدم استخدامها في النصوص البرمجية الجديدة.

لحذف حقل رقم الهاتف هذا.

// Retrieves and deletes the work phone number field for contact 'John
// Doe'
const contacts = ContactsApp.getContactsByName('John Doe');
const phoneFields = contacts[0].getPhones(ContactsApp.Field.WORK_PHONE);
phoneFields[0].deletePhoneField();

التفويض

تتطلّب النصوص البرمجية التي تستخدِم هذه الطريقة الحصول على إذن واحد أو أكثر من النطاقات التالية:

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

تمّ إيقاف هذا العمود نهائيًا. تم إيقاف هذه الدالة نهائيًا ويجب عدم استخدامها في النصوص البرمجية الجديدة.

احصل على رقم الهاتف لهذا الحقل.

// Logs the work phone number for contact 'John Doe'
const contacts = ContactsApp.getContactsByName('John Doe');
const phoneFields = contacts[0].getPhones(ContactsApp.Field.WORK_PHONE);
Logger.log(phoneFields[0].getPhoneNumber());

الإرجاع

String: الرقم بالتنسيق السلسلي

التفويض

تتطلّب النصوص البرمجية التي تستخدِم هذه الطريقة الحصول على إذن واحد أو أكثر من النطاقات التالية:

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

تمّ إيقاف هذا العمود نهائيًا. تم إيقاف هذه الدالة نهائيًا ويجب عدم استخدامها في النصوص البرمجية الجديدة.

تُستخدَم لضبط رقم الهاتف لهذا الحقل.

// Sets the work phone number for contact 'John Doe'
const contacts = ContactsApp.getContactsByName('John Doe');
const phoneFields = contacts[0].getPhones(ContactsApp.Field.WORK_PHONE);
phoneFields[0].setPhoneNumber('212-555-1234');

المعلمات

الاسمالنوعالوصف
numberStringالرقم الجديد

الإرجاع

PhoneField: هذا الحقل مفيد لإنشاء سلاسل.

التفويض

تتطلّب النصوص البرمجية التي تستخدِم هذه الطريقة الحصول على إذن واحد أو أكثر من النطاقات التالية:

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