Class CustomField
Koleksiyonlar ile düzeninizi koruyun
İçeriği tercihlerinize göre kaydedin ve kategorilere ayırın.
Kullanımdan kaldırılan yöntemler
Ayrıntılı dokümanlar
getLabel()
Bu alanın etiketini alır. Bu bir Alan, Genişletilmiş Alan veya Dize olabilir.
// 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());
}
Return
Object: Bu alanın etiketi
Yetkilendirme
Bu yöntemi kullanan komut dosyalarının aşağıdaki kapsamlardan bir veya daha fazlası için yetkilendirilmesi gerekir:
-
https://www.google.com/m8/feeds
setLabel(label)
Bu alanın etiketini ayarlar.
// 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');
Parametreler
| Ad | Tür | Açıklama |
label | String | bu alanın yeni etiketi |
Return
CustomField: zincirleme için yararlı olan bu alan
Yetkilendirme
Bu yöntemi kullanan komut dosyalarının aşağıdaki kapsamlardan bir veya daha fazlası için yetkilendirilmesi gerekir:
-
https://www.google.com/m8/feeds
Kullanımdan kaldırılan yöntemler
deleteCustomField()
Kullanımdan kaldırıldı. Bu işlevin desteği sonlandırılmıştır ve yeni komut dosyalarında kullanılmamalıdır.
Bu alanı siler.
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();
}
}
Yetkilendirme
Bu yöntemi kullanan komut dosyalarının aşağıdaki kapsamlardan bir veya daha fazlası için yetkilendirilmesi gerekir:
-
https://www.google.com/m8/feeds
getValue()
Kullanımdan kaldırıldı. Bu işlevin desteği sonlandırılmıştır ve yeni komut dosyalarında kullanılmamalıdır.
Alanın değerini alır.
// 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());
}
Return
Object: Alanda depolanan değer
Yetkilendirme
Bu yöntemi kullanan komut dosyalarının aşağıdaki kapsamlardan bir veya daha fazlası için yetkilendirilmesi gerekir:
-
https://www.google.com/m8/feeds
setLabel(field)
Kullanımdan kaldırıldı. Bu işlevin desteği sonlandırılmıştır ve yeni komut dosyalarında kullanılmamalıdır.
Bu alanın etiketini ayarlar.
// 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');
Parametreler
Return
CustomField: zincirleme için yararlı olan bu alan
Yetkilendirme
Bu yöntemi kullanan komut dosyalarının aşağıdaki kapsamlardan bir veya daha fazlası için yetkilendirilmesi gerekir:
-
https://www.google.com/m8/feeds
setValue(value)
Kullanımdan kaldırıldı. Bu işlevin desteği sonlandırılmıştır ve yeni komut dosyalarında kullanılmamalıdır.
Bu alanın değerini ayarlar.
// 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');
Parametreler
| Ad | Tür | Açıklama |
value | Object | yeni değer |
Return
CustomField: zincirleme için yararlı olan bu alan
Yetkilendirme
Bu yöntemi kullanan komut dosyalarının aşağıdaki kapsamlardan bir veya daha fazlası için yetkilendirilmesi gerekir:
-
https://www.google.com/m8/feeds
Aksi belirtilmediği sürece bu sayfanın içeriği Creative Commons Atıf 4.0 Lisansı altında ve kod örnekleri Apache 2.0 Lisansı altında lisanslanmıştır. Ayrıntılı bilgi için Google Developers Site Politikaları'na göz atın. Java, Oracle ve/veya satış ortaklarının tescilli ticari markasıdır.
Son güncelleme tarihi: 2025-07-26 UTC.
[null,null,["Son güncelleme tarihi: 2025-07-26 UTC."],[],["The `CustomField` in the Contacts API is deprecated in favor of the People API. It allows interacting with a custom field in a contact, using `getLabel()` to retrieve the field's label and `setLabel(label)` to change it. Deprecated methods include `deleteCustomField()` to remove the field, `getValue()` to get the field's value, `setLabel(field)` to set a label, and `setValue(value)` to assign the field's value. These actions require specific authorization scopes.\n"]]