Dear all,
The following is the code i have used to update the contacts, it is
getting updated the first time but for the second time it is not
updating if we change the contact name ((i.e)entry.setTitle
(google.gdata.Text.create('JS'));)
Only when we change the email ID it is getting changed.
// Create the contacts service object
var contactsService =
new google.gdata.contacts.ContactsService('GoogleInc-
jsguide-1.0');
// The feed URI that is used to create a contact entry
var feedUri = 'http://www.google.com/m8/feeds/contacts/default/full';
// Create an instance of ContactEntry
var entry = new google.gdata.contacts.ContactEntry();
// Set the name of the contact
entry.setTitle(google.gdata.Text.create('JS'));
// Set the content of the contact
entry.setContent(google.gdata.Text.create('content info here'));
var email = new google.gdata.Email();
email.setAddress('[email protected]');
email.setPrimary(true);
email.setRel(google.gdata.Email.REL_HOME);
entry.addEmailAddress(email);
var email1 = new google.gdata.Email();
email1.setAddress('[email protected]');
email1.setRel(google.gdata.Email.REL_WORK);
entry.addEmailAddress(email1);
// The callback method that will be called after a successful
insertion from insertEntry()
var callback = function(result) {
PRINT('contact entry created!');
}
// Error handler will be invoked if there is an error from insertEntry
()
var handleError = function(error) {
PRINT(error.message);
// alert(error.cause ? error.cause.statusText : error.message);
}
// Submit the request using the contacts service object
contactsService.insertEntry(feedUri, entry, callback,
handleError, google.gdata.contacts.ContactEntry);
Please someone help me with what i have to do as i am very new to
contact API.
Thanks in advance,
Kind Regards,
Angeline
--
You received this message because you are subscribed to the Google Groups
"Google Contacts API" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/google-contacts-api?hl=en.