Fields | fields property
TOC
Collapse the table of content
Expand the table of content

Contact.Fields | fields property

[Fields may be altered or unavailable for releases after Windows 8.1. Instead, use Phones, Emails, Addresses, or ConnectedServiceAccounts. ]

Sets the fields that contain information about a contact.

Syntax


var fields = contact.fields;

Property value

Type: IVector<IContactField> [JavaScript/C++] | System.Collections.Generic.IList<IContactField> [.NET]

An array of fields containing information about a contact.

Remarks

The ContactFieldCategory and ContactFieldType classes provide information about what kind of information you can put into a field.

Examples

These functions show how you can add different fields to a Contact object.


function appendField(fields, value, type, category) {
    if (value) {
        fields.append(new Windows.ApplicationModel.Contacts.ContactField(value, type, category));
    }
}



function appendEmail(fields, email, category) {
    // Adds a new email to the contact fields vector
    appendField(fields, email, Windows.ApplicationModel.Contacts.ContactFieldType.email, category);
}



function appendPhoneNumber(fields, phone, category) {
    // Adds a new phone number to the contact fields vector
    appendField(fields, phone, Windows.ApplicationModel.Contacts.ContactFieldType.phoneNumber, category);
}



function appendAddress(fields, address, category) {
    // Adds a new address to the contact fields vector
    if (address) {
        fields.append(new Windows.ApplicationModel.Contacts.ContactLocationField(
                        address.full, category, address.street, address.city, address.state, "", address.zipCode));
    }
}


Requirements (Windows 10 device family)

Device family

Universal, introduced version 10.0.10240.0

API contract

Windows.Foundation.UniversalApiContract, introduced version 1.0

Namespace

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

Metadata

Windows.Foundation.UniversalApiContract.winmd

Requirements (Windows 8.x and Windows Phone 8.x)

Minimum supported client

Windows 8

Minimum supported server

Windows Server 2012

Minimum supported phone

Windows Phone 8.1 [Windows Phone Silverlight 8.1 and Windows Runtime apps]

Namespace

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

Metadata

Windows.winmd

See also

Contact

 

 

Show:
© 2016 Microsoft