1

Is there a way to curb the number of results that come back from a RetreiveMultiple?

I am doing something very similar to the following:

ColumnSet cols = new ColumnSet();

// Set the properties of the ColumnSet.
cols.Attributes = new string [] {"fullname", "contactid"};

// Create the ConditionExpression.
ConditionExpression condition = new ConditionExpression();

// Set the condition for the retrieval to be when the contact's address' city is Sammamish.
condition.AttributeName = "address1_city";
condition.Operator = ConditionOperator.Like;
condition.Values = new string [] {"Sammamish"};

// Create the FilterExpression.
FilterExpression filter = new FilterExpression();

// Set the properties of the filter.
filter.FilterOperator = LogicalOperator.And;
filter.Conditions = new ConditionExpression[] {condition};

// Create the QueryExpression object.
QueryExpression query = new QueryExpression();

// Set the properties of the QueryExpression object.
query.EntityName = EntityName.contact.ToString();
query.ColumnSet = cols;
query.Criteria = filter;

// Retrieve the contacts.
BusinessEntityCollection contacts = service.RetrieveMultiple(query);

0 Answers0