top

ATTRIBUTEFILTER

AttributeFilter represents a filter based on an object attribute. If no matchValue is defined, the filter will match all objects that have the attribute defined (“EXISTS” filter), otherwise, it will only match objects whose attribute matches the given value.

Add the following line for AttributeFilter class into a html file your own :

  script type="text/javascript" src="$MANAGER_WIDGET/Common/webapi/1.0/webapis.js">/script>

You can declare AttributeFilter class like this :

  ex) var filter = new webapis.AttributeFilter("parm1", "parm2", "parm3");


Constructor

AttributeFilter

Description
AttributeFilter represents a filter based on an object attribute. If no matchValue is defined, the filter will match all objects that have the attribute defined (“EXISTS” filter), otherwise, it will only match objects whose attribute matches the given value.
Parameters
attributeName DOMStringName of the object attribute used for filtering. This is the name of the object attribute exactly as it is defined in the object’s interface. For attributes of complex type, use fully-qualified names (e.g. ‘organizations.role’ to filter on a contact’s role in an organization). For attributes of array type, the filter will match if any value in the array matches.
matchFlag FilterMatchFlagA match flag used for attribute-based filtering. By default, this attribute is set to “EXACTLY”.
matchValue ObjectValue used for matching. The filter will match if the attribute value matches the given matchValue. This value is not used if the matchFlag is set to “EXISTS”. By default, this attribute is set to null.
Emulator Support
SDK Constraint
Example
// Define success callback
function successCB(contacts) {
    console.log(contacts.length + " contacts found.");
}

// Define error callback
function errorCB(error) {
    console.log("An error occurred: " + error.message);
}

// Create an attribute filter based on first name: "First name should contain 'Chris' (case insensitive)"
var filter = new webapis.AttributeFilter("name.firstName", "CONTAINS", "Chris");
// Send request on contact address book.
webapis.contact.getDefaultAddressBook().find(successCB, errorCB, filter);