The following operations allow you to work The following operations allow you to work with retrieve entities. Click an operation name to see details on how to use it:
- retrieveEntity
- retrieveByExpandingNavigationProperties
- retrieveNavigationPropertyValues
- retrieveSingleProperty
- retrieveSpecificProperties
...
to use it:
- retrieveEntity
- retrieveByExpandingNavigationProperties
- retrieveNavigationPropertyValues
- retrieveSingleProperty
- retrieveSpecificProperties
For a sample proxy service that illustrates how to work with retrieve entities, see Sample configuration.
Retrieve Entity
To retrieve data of an entity, use msdynamics365.retrieveEntity
.
Code Block | ||
---|---|---|
| ||
<msdynamics365.retrieveEntity> <entityType>{$ctx:entityType}</entityType> <primaryKeyValueOrAlternateKey>{$ctx:primaryKeyValueOrAlternateKey}</primaryKeyValueOrAlternateKey> </msdynamics365.retrieveEntity> |
Properties
- <entityType>: Mandatory. The type of an entity (i.e accounts, opportunities, contacts and etc).
- <primaryKeyValueOrAlternateKey>: Mandatory. The primary key value of an entity or use the alternate key to retrieve the entity instead of the unique identifier ( primary key value).
Sample request
Following is a sample R EST/JSON request that can be handled by the retrieveEntity
operation.
...
Retrieve Related Entities by Expanding Navigation Properties
To retrieve related entities for an entity by expanding navigation propertiescontrol what data from related entities is returned based on the navigation properties (Single or collection), use msdynamics365.
retrieveByExpandingNavigationProperties
.
Code Block | ||
---|---|---|
| ||
<msdynamics365.retrieveByExpandingNavigationProperties> <entityType>{$ctx:entityType}</entityType> <primaryKeyValue>{$ctx:primaryKeyValue}</primaryKeyValue> <queryParam>{$ctx:queryParam}</queryParam> </msdynamics365.retrieveByExpandingNavigationProperties> |
Properties
- <entityType>: Mandatory. The type of an entity (i.e., accounts, opportunities, contacts etc).
- <primaryKeyValue>: Mandatory. The primary key value of an entity.
<queryParam>: The query option to control what data is returned from related entities. You can use single-valued navigation properties or collection-valued navigation properties here.
Sample request
Following is a sample R EST/JSON request that can be handled by the retrieveByExpandingNavigationProperties
operation.
...
Info |
---|
For more information on Retrieve Entities by Expanding Navigation Properties, see https://msdn.microsoft.com/en-us/library/mt607871.aspx#bkmk_expandRelated. |
Retrieve
...
Navigation Property Values
To retrieve individual property values and also to access the values of navigation properties (lookup fields), use msdynamics365.retrieveNavigationPropertyValues
.
Code Block | ||
---|---|---|
| ||
<msdynamics365.retrieveNavigationPropertyValues> <entityType>{$ctx:entityType}</entityType> <primaryKeyValue>{$ctx:primaryKeyValue}</primaryKeyValue> <navigationPropertyValue>{$ctx:navigationPropertyValue}</navigationPropertyValue> <referenceOrCountOfEntity>{$ctx:referenceOrCountOfEntity}</referenceOrCountOfEntity> <queryParam>{$ctx:queryParam}</queryParam> </msdynamics365.retrieveNavigationPropertyValues> |
Properties
- <entityType>: Mandatory. The type of an entity (i.e., accounts, opportunities, contacts etc).
- <primaryKeyValue>: Mandatory. The primary key value of an entity.
- <navigationPropertyValue>: Mandatory. This can be either a single-valued navigation property name or a collection-valued navigation property name.
- <referenceOrCountOfEntity>: Mandatory. Use this property if you use the collection-valued navigation property to return only references to the related entities or just a count of the related entities. Possible values are $ref or $count.
- <queryParam>: Mandatory. Use this property if you use the single-valued navigation property to retrieve data of an entity.
Sample request
Following is a sample REST/JSON request that can be handled by the retrieveNavigationPropertyValues
(collection-valued and single-valued navigation properties) operation.
...
Info |
---|
For more information on Retrieve Navigation Property Values, see https://msdn.microsoft.com/en-us/library/mt607871.aspx#bkmk_retrieveNavigationPropertyValues. |
Retrieve
...
Single Property Value
To retrieve the value of the specific property of an entity, use msdynamics365.retrieveSingleProperty
.
Code Block | ||
---|---|---|
| ||
<msdynamics365.retrieveSingleProperty> <entityType>{$ctx:entityType}</entityType> <singlePropertyName>{$ctx:singlePropertyName}</singlePropertyName> <primaryKeyValue>{$ctx:primaryKeyValue}</primaryKeyValue> </msdynamics365.retrieveSingleProperty> |
Properties
- <entityType>: Mandatory. The type of an entity (i.e., accounts, opportunities, contacts etc).
- <singlePropertyName>: Mandatory. The name of the property that you want to retrieve.
- <primaryKeyValue>: Mandatory. The primary key value of an entity.
Sample request
Following is a sample REST/JSON request that can be handled by the retrieveSingleProperty
operation.
Code Block | ||||
---|---|---|---|---|
| ||||
{ "apiUrl":"https://wso2.crm5.dynamics.com", "accessToken":"eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsIng1dCI6IjlGWERwYmZNRlQyU3", "refreshToken":"AQABAAAAAABnfiG-mA6NTae7CdWW7Qfd0aAk9Jh2jERSJt61ivkdC_8VpI4B75AWvtviJErRhnzKIDvt", "clientSecret":"iDJ7gQ81N+JAW9Ql2/ikMzc9og", "clientId":"c12ec5be-8356-ed0915a", "resource":"https://wso21234.crm5.dynamics.com/", "registryPath":"", "intervalTime":"", "entityType":"accounts", "primaryKeyValue":"00000000-0000-0000-0000-000000000001", "singlePropertyName":"name" } |
...
Code Block | ||
---|---|---|
| ||
<msdynamics365.retrieveSpecificProperties> <entityType>{$ctx:entityType}</entityType> <primaryKeyValue>{$ctx:primaryKeyValue}</primaryKeyValue> <queryParam>{$ctx:queryParam}</queryParam> </msdynamics365.retrieveSpecificProperties> |
Properties
- <entityType>: Mandatory. The type of an entity (i.e., accounts, opportunities, contacts etc).
- <primaryKeyValue>: Mandatory. The primary key value of an entity.
<queryParam>: Mandatory. Specify the names of the properties that you want to return.
Sample request
Following is a sample REST/JSON request that can be handled by the retrieveSpecificProperties
operation.
...
Info |
---|
For more information on Retrieve Specific Properties, see https://msdn.microsoft.com/en-us/library/mt607871.aspx#bkmk_requestProperties. |
Sample configuration
Following is a sample proxy service that illustrates how to connect to Microsoft Dynamics 365 with the init
operation and use the retrieveEntity
operation. To view the sample request for this proxy, see Sample Request for the retrieveEntity operation. You can use this sample as a template for the other operations in this category.
...