The RetrieveMultiple operation provides more capabilities to select data from Microsoft Dynamics CRM. The following types of RetrieveMultiple operations can be configured:
Note: Because of a large amount of entities, the adapter can take an extended period of time to perform this operation, which can exhaust your system memory resources.
<AttributeName>...</AttributeName> <Operator>...</Operator> <Value>...</Value>
The following SelectByCondition example uses sample parameters:
<AttributeName>invoice_number</AttributeName> <Operator>Equal</Operator> <Values> <Value>1234567</Value> </Values>
You can specify as many conditions as you require. All of the conditions are added with only one logical operator, And or Or. The And logical operator only returns entities that satisfy all of the specified conditions. The Or logical operator only returns entities that satisfy at least one specified condition. You can combine different conditions.
Note: Specifying more conditions will return more specific data from Microsoft Dynamics CRM. However, a lower number of results are returned. Specifying less conditions will return a greater number of results. However, these results tend to be less accurate.
The following table shows the logical operators for attributes and values that iWay Application Adapter for Microsoft Dynamics CRM 2011 On-Premises supports.
Operator | Description |
---|---|
BeginsWith | The string occurs at the beginning of another string. |
Between | The value is between two values. |
ChildOf | Currently unsupported. |
DoesNotBeginWith | The string does not begin with another string. |
DoesNotEndWith | The string does not end with another string. |
EndsWith | The string ends with another string. |
Equal | The values are compared for equality. |
EqualBusinessId | The value is equal to the specified business ID. |
EqualUserId | The value is equal to the specified user ID. |
EqualUserLanguage | The value is equal to the language for the user. |
EqualUserTeams | The record is owned by teams that the user is a member of. |
GreaterEqual | The value is greater than or equal to the compared value. |
GreaterThan | The value is greater than the compared value. |
In | The value exists in a list of values. |
InFiscalPeriod | The value is within the specified fiscal period. |
InFiscalPeriodAndYear | The value is within the specified fiscal period and year. |
InFiscalYear | The value is within the specified year. |
InOrAfterFiscalPeriodAndYear | The value is within or after the specified fiscal period and year. |
InOrBeforeFiscalPeriodAndYear | The value is within or before the specified fiscal period and year. |
Lasy7Days | The value is within the last seven days including today. |
LastFiscalPeriod | The value is within the last fiscal period. |
LastFiscalYear | The value is within the last fiscal year. |
LastMonth | The value is within the last month including first day of the last month and last day of the last month. |
LastWeek | The value is within the previous week including Sunday through Saturday. |
LastXDays | The value is within last X days. |
LastXFiscalPeriods | The value is within the last X (specified value) fiscal periods. |
LastXFiscalYears | The value is within the last X (specified value) fiscal periods. |
LastXHours | The value is within the last X hours. |
LastXMonths | The value is within the last X (specified value) months. |
LastXWeeks | The value is within the last X (specified value) weeks. |
LastXYears | The value is within the last X years. |
LastYear | The value is within the previous year. |
LessEqual | The value is less than or equal to the compared value. |
LessThan | The value is less than the compared value. |
Like | The character string is matched to the specified pattern. |
Mask | The value is found in the specified bit-mask value. |
MaskSelect | Currently unsupported. |
Next7Days | The value is within the next seven days. |
NextFiscalPeriod | The value is within the next fiscal period. |
NextFiscalYear | The value is within the next fiscal year. |
NextMonth | The value is within the next month. |
NextWeek | The value is within the next week. |
NextXDays | The value is within the next X (specified value) days. |
NextXFiscalPeriods | The value is within the next X (specified value) fiscal period. |
NextXFiscalYears | The value is within the next X (specified value) fiscal years. |
NextXHours | The value is within the next X (specified value) hours. |
NextXMonths | The value is within the next X (specified value) months. |
NextXWeeks | The value is within the next X weeks. |
NextXYears | The value is within the next X years. |
NextYear | The value is within the next year. |
NotBetween | The value is not between two values. |
NotEqual | The two values are not equal. |
NotEqualBusinessId | The value is not equal to the specified business ID. |
NotEqualUserId | The value is not equal to the specified user ID. |
NotIn | The given value is not matched to a value in a subquery or a list. |
NotLike | The character string does not match the specified pattern. |
NotMask | The value is not found in the specified bit-mask value. |
NotNull | The value is not null. |
Null | The value is null. |
OlderthanXMonths | The value is older than the specified number of months. |
On | The value is on a specified date. |
OnOrAfter | The value is on or after a specified date. |
OnOrBefore | The value is on or before a specified date. |
ThisFiscalPeriod | The value is within the current fiscal period. |
ThisFiscalYear | The value is within the current fiscal year. |
ThisMonth | The value is within the current month. |
ThisWeek | The value is within the current week. |
ThisYear | The value is within the current year. |
Today | The value equals the date today. |
Tomorrow | The value equals the date tomorrow. |
Yesterday | The value equals the date yesterday. |
Many of the operators are type-specific. For some logical operators (for example, In), it is possible to specify more than one value for an attribute. In this case, all <Value> elements must be included within the <Values> element, as shown below:
<Values>...</Values>
Other logical operators require no values. For such operations, the <Value> element must be omitted.
The condition operator, Like, allows you to perform pattern matching.
You can choose from the following patterns:
The following example shows the use of a percent character (%) wildcard:
<Condition> <AttributeName>name</AttributeName> <Operator>Like</Operator> <Values> <Value>My%</Value> </Values> </Condition>
The result returns all entities whose name begins with My.
The following example shows the use of an underscore character (_) wildcard:
<Condition> <AttributeName>name</AttributeName>| <Operator>Like</Operator> <Values> <Value>My_ccount1</Value> </Values> </Condition>
The result returns the entity whose name is 10 characters long, where the first two characters are My, and the last seven characters is ccount1.
The following is an example of a condition by multiple fields.
<Criteria> <Conditions> <ConditionExpression> <AttributeName>name</AttributeName> <Operator>Equal</Operator> <Values> <Value>Some Account</Value> </Values> </ConditionExpression> </Conditions> <FilterOperator>And</FilterOperator> <Filters> <is:FilterExpression> <is:Conditions> <is:ConditionExpression> <is:AttributeName>accountnumber</is:AttributeName> <is:Operator>Equal</is:Operator> <is:Values> <is:Value>2</is:Value> </is:Values> </is:ConditionExpression> </is:Conditions> <is:FilterOperator>And</is:FilterOperator> </is:FilterExpression> </Filters> </Criteria>
FilterExpression can also contain other filter expressions. It allows the creation of very complex and powerful conditions.
The RetrieveMultiple request contains the following parameters:
Parameter | Description | Operation |
---|---|---|
ColumnSet | This defines the attributes, which are included in the response document. All the existing attributes will be returned by MS CRM in an instance document, when this element is skipped. | All |
LinkEntities | This defines the filtering of records in a response document by the values of attributes of some related entities. | All |
NoLock | This retrieves or sets a value that indicates that no shared locks are issued against the data that would prohibit other transactions from modifying the data in the records returned from the query. | All |
Distinct | This retrieves or sets whether the results of the query contain duplicate entity instances. | SelectAll, SelectByCondition |
Orders | This is the order in which the entity instances are returned from the query. | SelectAll, SelectByCondition |
PageInfo | This retrieves or sets the number of pages and the number of entity instances per page returned from the query. The response contains related information, including the total record count (if requested) and paging cookie (a string generated from requested paging criteria that may be used in the next requests to fasten data retrieval). | Select All, SelectByCondition |
Note: Use paging if you expect large datasets to be returned. Large amounts of data may cause excessive memory consumption in the adapter, and cause errors or exceptions to be generated. Try to restrict the returned data with more precise selections and retry the request.
iWay Software |