ODataService Read¶
Read action is used to send a read request to the target OData Service.
The result of the action can be accessed in the OnSuccess event and will be available in the ActionResult.data in the format of JSON String.
All the properties defined under Action are applicable to this action.
ODataService Read Properties¶
Property | Type | Required |
---|---|---|
Headers | object |
No |
Properties | string[] |
No |
RequestOptions | RequestOptions | No |
Target | QueryTarget | Yes |
_Type | const |
Yes |
Headers¶
Custom headers to be included as part of the request to the OData Service in key/value pair format
- type:
object
Properties¶
Names of the properties to be included in the query result. If not set, all properties will be returned. Complex and Binary property type is supported.
- type:
string[]
All items must be of the type: string
RequestOptions¶
Options for processing of data requests
- type: RequestOptions
Target¶
- type: QueryTarget
_Type¶
- type:
const
The value of this property must be:
"Action.Type.ODataService.Read"
Action Result¶
Refer to the MDK Guide to understand what an action result is.
The success ActionResult of this action is a JS array containing the read entity collection. The failure ActionResult is an error message.
Examples¶
Read¶
{
"_Type": "Action.Type.ODataService.Read",
"Target": {
"Service": "/MyMDKApp/Services/MyOData.service",
"EntitySet": "Customers",
"QueryOptions": "$filter=CustomerID eq '1234'"
}
}
Read selected properties¶
{
"_Type": "Action.Type.ODataService.Read",
"Target": {
"Service": "/MyMDKApp/Services/MyOData.service",
"EntitySet": "Customers"
},
"Properties": ["CustomerID", "CompanyName"]
}