ContactPickerUI.RemoveContact | removeContact method

Applies to Windows only

Removes a contact.

Note  The Contact.Id property must be set when you call RemoveContact. If Contact.Id isn't set, your app won't be able to remove the contact.

Syntax


contactPickerUI.removeContact(id);

Parameters

id

Type: String [JavaScript] | System.String [.NET] | Platform::String [C++]

The ID of the contact to remove.

Examples

The following example removes a contact from the contact picker.


function removeContactFromBasket(sampleContact) {
    // Programmatically remove the contact from the basket.
    if (contactPickerUI.containsContact(sampleContact.id)) {
        contactPickerUI.removeContact(sampleContact.id);
        document.getElementById("statusMessage").innerText = sampleContact.name + " was removed from the basket";
    }
}

Requirements

Minimum supported client

Windows 8

Minimum supported server

Windows Server 2012

Minimum supported phone

None supported

Namespace

Windows.ApplicationModel.Contacts.Provider
Windows::ApplicationModel::Contacts::Provider [C++]

Metadata

Windows.winmd

See also

Contact Picker app sample
ContactPickerUI

 

 

Show:
© 2014 Microsoft