ContactAddress

The ContactAddress object contains the address information of a Contact object.


Code Example:
function createContact() {
    var contacts = blackberry.pim.contacts,
        ContactAddress = contacts.ContactAddress;

    var homeAddress = {
             "type": ContactAddress.HOME,
             "streetAddress": "123 Abc Rd",
             "locality": "Waterloo",
             "region": "Ontario",
             "country": "Canada"
       };
    var workAddress = {
             "type": ContactAddress.WORK,
             "streetAddress": "456 Industry St",
             "locality": "Waterloo",
             "region": "Ontario",
             "country": "Canada"
        };

    var newContact = contacts.create();
    newContact.name = {
        "givenName": "Bart",
        "familyName": "Simpson"
    };
    newContact.addresses = [homeAddress, workAddress];

    newContact.save(onSaveSuccess, onSaveError);
}

function onSaveSuccess(contact) {
    alert("Contact saved: " + contact.name.givenName);
}

function onSaveError(error) {
    alert("Contact save failed: " + error.code);
}


Supported Platform(s)

- BlackBerry 10
View Supported Platform Table
APIBB5.0BB6.0BB7.0PB1.0PB2.0BB10Ripple
country           Y 
formatted           Y 
locality           Y 
postalCode           Y 
region           Y 
streetAddress           Y 
streetOther           Y 
type           Y 
HOME           Y 
WORK           Y 
OTHER           Y 

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 IDBB5.0BB6.0BB7.0PB1.0PB2.0BB10Ripple
<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 country
String formatted
String locality
String postalCode
String region
String streetAddress
String streetOther
String type

Constants

String HOME
String WORK
String OTHER

Properties

String country


The country name.


Supported Platforms
 - BlackBerry 10

readonly String formatted


A formatted version of the full address, for display.


Supported Platforms
 - BlackBerry 10

String locality


The city or locality.


Supported Platforms
 - BlackBerry 10

String postalCode


The postal code or zip code.


Supported Platforms
 - BlackBerry 10

String region


The province, state, or region.


Supported Platforms
 - BlackBerry 10

String streetAddress


The street address.


Supported Platforms
 - BlackBerry 10

String streetOther


Extra information about the street address.


Supported Platforms
 - BlackBerry 10

String type


Specifies the type of ContactAddress.


Supported Platforms
 - BlackBerry 10

Constants

static String HOME = "home"


The type of ContactAddress is "home".


Supported Platforms
 - BlackBerry 10

static String WORK = "work"


The type of ContactAddress is "work".


Supported Platforms
 - BlackBerry 10

static String OTHER = "other"


The type of ContactAddress is "other".


Supported Platforms
 - BlackBerry 10

Documentation generated by JsDoc Toolkit 2.4.0 on Sun Dec 30 2012 18:15:35 GMT-0500 (EST)