Defining Request¶
Removing Defining Requests¶
The action - Action.Type.OfflineOData.RemoveDefiningRequest
can be used to remove existing defining requests from a specified Offline OData store. This action takes Offline OData service path and the name of a defining request as input parameters, and removes one defining request at a time. For example,
{
"_Type": "Action.Type.OfflineOData.RemoveDefiningRequest",
"Service": "/MyMDKApp/Services/MyOData.service",
"DefiningRequest": {
"Name": "Product Name"
}
}
Note
- This action can only be triggered after the corresponding offline service has been initialized, and if there are no pending changes.
- Removing a defining request will delete all the local data (Entities downloaded from the backend, relationships associated with the entities, and their media streams) associated with it in the Offline OData Provider, unless another defining request is addressing the same data.
- If non-shared delta tracking is enabled, name of the defining request and its change logs on the server will be deleted during next download.
This action requires the allow_defining_query_removal
key to Y
in the offline configuration for the given app in the mobile services cockpit (Mobile Offline Access > configuration > Endpoint Customization
).
Certain defining requests can be removed using this Offline OData action even if the allow_defining_query_removal
key is not enabled. Defining requests that identifies a single media entity in the Offline store, with automaticallyRetrievesStreams
property set to true
falls under this exception.
For more information, see RemoveDefiningRequest
Action.
Retrieving Defining Requests¶
getDefiningRequests()
is an API in OfflineDataProviderProxy
that returns an array of defining requests that are associated with the service with the following read-only properties:
- Name - Name of the defining request.
- Query - The URL string of the defining request.
- AutomaticallyRetrievesStreams - Indicates whether the stream is automatically being retrieved or not.
- IsRemoving - Indicates whether the defining request is being removed or not.
Note
This API can be used if the corresponding Offline OData service has been initialized.
For more information, see OfflineDataProviderProxy > getDefinitionRequest()
.