Contact

The Contact object represents a contact in the device PIM. It can be obtained by calling blackberry.pim.contacts.create() or blackberry.pim.contacts.find().

Installation:

To use this API in your project, add the contacts plugin:

webworks plugin add com.blackberry.pim.contacts

Learning Resources:

Sample - Working with Contacts Sample that demonstrates how to use the BlackBerry Contacts API [BlackBerry Community Samples on GitHub].

clone()

Returns a new Contact object that is a deep copy of the calling object, with the id property set to null.

Synopsis:

blackberry.pim.contacts.Contact Contact.clone()

Returns:

{blackberry.pim.contacts.Contact}

The contact object

remove()

Removes the contact from the device contacts database. An error callback is called with a blackberry.pim.contacts.ContactError object if the removal is unsuccessful.

Synopsis:

void Contact.remove()

Parameters:

onRemoveSuccess {Function}

The callback function that will be invoked when the contact is removed successfully.

onRemoveError {function}

The callback function that will be invoked when the contact cannot be removed.

error {blackberry.pim.contacts.ContactError}

The blackberry.pim.contacts.ContactError object which contains the error code. Possible errors are: permission denied error (if access_pimdomain_contacts is not specified) or illegal arguments error (if mandatory parameters are missing or invalid).

save()

Saves a new contact to the device contacts database, or updates an existing contact if a contact with the same id already exists.

Synopsis:

void Contact.save()

Parameters:

onSaveSuccess {Function}

The callback function that will be invoked when the contact is saved successfully.

contact {blackberry.pim.contacts.Contact}

The Contact object.

onSaveError {function}

The callback function that will be invoked when the contact cannot be saved. Possible errors are: permission denied error (if access_pimdomain_contacts is not specified) or illegal arguments error (if mandatory parameters are missing or invalid).

error {blackberry.pim.contacts.ContactError}

The blackberry.pim.contacts.ContactErrorobject which contains the error code.

activities

An array of the contact's latest activities.

Synopsis:

read-only
{blackberry.pim.contacts.ContactActivity[]} Contact.activities

addresses

An array of all the contact's addresses.

Synopsis:

{blackberry.pim.contacts.ContactAddress[]} Contact.adresses

anniversary

The anniversary of the contact.

Synopsis:

Date Contact.anniversary

birthday

The birthday of the contact.

Synopsis:

Date Contact.birthday

categories

An array of all the contacts user defined categories.

Synopsis:

{blackberry.pim.contacts.ContactField[]} Contact.categories

displayName

The name of this Contact, suitable for display to end-users.

Synopsis:

String Contact.displayName

favorite

Whether this contact is a favorite.

Synopsis:

Boolean Contacts.favorite

faxNumbers

An array of all the contact's fax numbers.

Synopsis:

 blackberry.pim.contacts.ContactField[] Contact.faxNumbers

id

A globally unique identifier.

Synopsis:

read-only
String Contact.id

ims

An array of all the contact's IM addresses.

Possible types: BbmPin, Aim, Aliwangwang, GoogleTalk, Sametime, Icq, Irc, Jabber, MsLcs, Msn, Qq, Skype, YahooMessenger, YahooMessengerJapan

Synopsis:

ContactField[] Contact.ims

name

An object containing all components of a person's name.

Synopsis:

blackberry.pim.contacts.ContactName Contact.name

news

An array of the contact's latest online news.

nickname

A casual name to address the contact by.

Synopsis:

String Contact.nickname

note

A note about the contact.

Synopsis:

String Contact.note

organizations

An array of all the contact's organizations.

Synopsis:

blackberry.pim.contacts.ContactOrganization[] Contact.organizations

pagerNumbers

An array of all the contact's pager numbers.

Synopsis:

blackberry.pim.contacts.ContactField[] Contact.pagerNumbers

phoneNumbers

An array of all the contact's phone numbers.

Synopsis:

blackberry.pim.contacts.ContactField[] Contact.phoneNumbers

photos

An array of the contact's photos.

ringtone

Ringtone for the contact.

Synopsis:

String Contact.ringtone

socialNetworks

An array of the contact's social networks. Possible types: LinkedIn, Facebook, Twitter, Gist

Synopsis:

blackberry.pim.contacts.ContactField[] Contact.socialNetworks

sourceAccounts

Retrieves a list of the accounts of the sources for this Contact.

Contacts can be merged from multiple accounts to form a single contact. For example, contacts might be merged from a personal account and a work account. If the same contact exists in both accounts, the contact information is merged into a single contact that includes all of the information from both accounts. This function returns all of the accounts that are sources for this contact.

Synopsis:

read-only
blackberry.pim.contacts.ContactAccount[] Contact.sourceAccounts

urls

An array of web pages associated to the contact. Possible types: blog, resume, portfolio, personal, company, other.

Synopsis:

blackberry.pim.contacts.ContactField[] Contact.urls

videoChat

An array of the contact's video chat IDs.

Synopsis:

String[] Contact.videoChat

Last modified: 2014-09-29



Got questions about leaving a comment? Get answers from our Disqus FAQ.

comments powered by Disqus