Show TOC

Local Information About Entities and RelationshipsLocate this document in the navigation structure

The offline store exposes information about whether or not entities and relationships are local.

During a read request, information about whether or not an entity or relationship is local is returned as an instance annotation; com.sap.vocabularies.Offline.v1.islocal is set to true. If the entity is not local, the annotation is note returned.

If an $expand is used, and an entity is included in the result because a locally modified relationship was expanded, an annotation for that entity shows that com.sap.vocabularies.Offline.v1.fromlocalrelationship is set to true. If the entity was expanded due to a relationship that is no local, this annotation is not returned.

Filtering on Local Information

The sap.islocal() built-in $filter function enables entities and relationships to be filtered based on whether they are local.

Example
~/Customers?$filter=sap.islocal()

Returns all Customers that were created or modified locally.

~/Customers(101)/$links/Orders?$filter=not sap.islocal()

Returns the link (URI) for all relationships between Customer 101 and its Orders that were not created or modified locally.

There are limitations with this function due to the nature of OData V2 queries:
  • The islocal function cannot be applied to expanded items. For example, ~/Customers?$expand=Orders&$filter=sap.islocal() returns all local Customers and all their Orders (not just their local Orders).
  • You cannot use the islocal function to filter relationships when doing expands. For example, it cannot be used to ask, “Give me all Customers and expand only local relationships to Orders”.
Checking If the Request Queue Is Empty

The offline store provides the getRequestQueueIsEmpty method to determine if the request queue is empty. See the OData Offline APIs.