ContactName
The ContactName object contains name properties of a blackberry.pim.contacts.Contact object.
Code Example:
function createContact() {
var contacts = blackberry.pim.contacts;
var name = {
"givenName": "John",
"familyName": "Smith"
};
var newContact = contacts.create();
newContact.name = name;
newContact.save(onSaveSuccess, onSaveError);
alert("Contact first name: " + newContact.name.givenName);
}
function onSaveSuccess(contact) {
alert("Contact saved: " + contact.name.givenName);
}
function onSaveError(error) {
alert("Contact save failed: " + error.code);
}
|
Configuration Document Settings
To use all of the API described for this object, you must ensure the following settings are in your configuration document:
|
You must declare the feature element(s) below in your configuration document:
|
Feature ID | BB5.0 | BB6.0 | BB7.0 | PB1.0 | PB2.0 | BB10 | Ripple |
<feature id="blackberry.pim.contacts" />
| |
|
|
|
|
Y | |
Permission Elements (PlayBook and BlackBerry 10+) |
This API does not require a <permission> element to be declared in the configuration document of your BlackBerry WebWorks Application.
|
Properties
String
alias
The contact's alias.
Supported Platforms
|
|
- BlackBerry 10
|
String
familyName
The contact's family name.
Supported Platforms
|
|
- BlackBerry 10
|
String
formatted
The complete name of the contact.
Supported Platforms
|
|
- BlackBerry 10
|
String
givenName
The contact's given name.
Supported Platforms
|
|
- BlackBerry 10
|
String
honorificPrefix
The contacts prefix (example Mr. or Dr.)
Supported Platforms
|
|
- BlackBerry 10
|
String
honorificSuffix
The contacts suffix (example Esq.).
Supported Platforms
|
|
- BlackBerry 10
|
String
middleName
The contact's middle name.
Supported Platforms
|
|
- BlackBerry 10
|
String
phoneticFamilyName
The contact's phonetic family name.
Supported Platforms
|
|
- BlackBerry 10
|
String
phoneticGivenName
The contact's phonetic given name.
Supported Platforms
|
|
- BlackBerry 10
|
Documentation generated by
JsDoc Toolkit 2.4.0 on Sun Dec 30 2012 18:15:35 GMT-0500 (EST)