我一直在尝试从为我们的大多数联系人定义的自定义字段中获取自定义值,但是我们没有从下面的脚本中获取任何数据,任何人都可以找出我的脚本哪里出错了。下面是我正在使用的示例脚本。
在下面的脚本中,我可以获得主要电子邮件值,但所有联系人的自定义字段值都是空白的,即使联系人中存在该值。
function GetContactDir() {
var All_Contacts = ContactsApp.getContacts();
var email = new String();
var cust = new String();
var Con_arr = new Array();
for (var i=0; i<All_Contacts.length; i++)
{
email = "";
email = All_Contacts[i].getPrimaryEmail();
Con_arr = All_Contacts[i].getCustomFields("Organization ID"); //NOT WORKING
if (!(email=="") && !(email==null) )
Browser.msgBox(email + " **" + Con_arr[0] + " ** " + String(i) );
}
}
问候, Saravana Kumar P.