Add Contact

The Contacts app will create a new contact and display a scene allowing the user to make edits or additions. Note that the contact is not actually created until the user presses 'Done'.

To do this, create a Contact object and pass it to the Contacts app, which you can launch using the Application Manager's open method.

See Also:

Example

var contact = {
    name: {
        "familyName": "Doe",
        "givenName": "John",
        "middleName": "J.",
        "honorificPrefix": "Mr."
    },

    birthday: "1977-01-18",
    nickname: "Johnny",
    phoneNumbers: [{
            value: "4085555678",
            type: "type_work",
            primary : true
        },{
            value: "4085558765",
            type: "type_fax",
            primary : false
        }
    ],
    emails: {
        value: "john@does.com",
        type: "type_work",
        primary : true
    },
    addresses: {
        "streetAddress": '123 Main St.',
        "locality": 'Centerville',
        "region": "CA",
        "postalCode": '98765',
        "country": "USA"
    },
    organizations : {
        "name"        : "John Doe and Sons",
        "title"       : "CEO",
        "primary"     : true
    }
}

this.controller.serviceRequest("palm://com.palm.applicationManager", {
    method: "open",
    parameters: 
        {
            id: "com.palm.app.contacts",
            params: 
            {
                contact: contact,
                launchType: "newContact"
            }
        }
});