Class CustomField

حقلمخصّص

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

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

الطُرق

الطريقةنوع القيمة التي يتم عرضهاوصف قصير
getLabel()Objectتحصل على تصنيف هذا الحقل.
setLabel(label)CustomFieldلضبط تصنيف هذا الحقل.
الطريقةنوع القيمة التي يتم عرضهاوصف قصير
deleteCustomField()voidيؤدي إلى حذف هذا الحقل.
getValue()Objectتحصل على قيمة الحقل.
setLabel(field)CustomFieldلضبط تصنيف هذا الحقل.
setValue(value)CustomFieldلضبط قيمة هذا الحقل

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

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

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: هذا الحقل مفيد لإنشاء سلاسل.

التفويض

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

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

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

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

يؤدي إلى حذف هذا الحقل.

const contacts = ContactsApp.getContactsByName('John Doe');
const fields = contacts[0].getCustomFields();
for (let i = 0; i < fields.length; i++) {
  if (fields[i].getLabel() === 'foo') {
    fields[i].deleteCustomField();
  }
}

التفويض

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

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

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

تحصل على قيمة الحقل.

// Logs the value of all the custom fields for contact 'John Doe'
const contacts = ContactsApp.getContactsByName('John Doe');
const fields = contacts[0].getCustomFields();
for (const i in fields) {
  Logger.log(fields[i].getValue());
}

الإرجاع

Object: القيمة المخزّنة في الحقل

التفويض

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

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

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

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

// Sets the first custom field associated with contact 'John Doe' to use 'Mail
// application' as a label, with 'Gmail' as the value.
const contacts = ContactsApp.getContactsByName('John Doe');
const field = contacts[0].getCustomFields()[0];
field.setLabel('Mail application');
field.setValue('Gmail');

المعلمات

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

الإرجاع

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

التفويض

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

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

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

لضبط قيمة هذا الحقل

// Sets the first custom field associated with contact 'John Doe' to use 'Mail
// application' as a label, with 'Gmail' as the value.
const contacts = ContactsApp.getContactsByName('John Doe');
const field = contacts[0].getCustomFields()[0];
field.setLabel('Mail application');
field.setValue('Gmail');

المعلمات

الاسمالنوعالوصف
valueObjectالقيمة الجديدة

الإرجاع

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

التفويض

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

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