Skip to content

Target

This document describes the metadata properties available to read an OData EntitySet. A Target entity can be used in many parts of a MDK application to specify an entity set to be retrieved. For example, a Target may define a query that is used to populate a list of items, or to provide the binding for a section inside a SectionedTable control. Either ReadLink or QueryOptions is required.

Target Properties

Property Type Required Default
EditLink string Optional
EntitySet string Required
QueryOptions string Optional
ReadLink string Optional
ServerSidePaging boolean Optional false
Service Service Required
UniqueIdType enum Optional

Entity's Edit Link. This is the entity ID path that uniquely identify the entity for editing e.g. Product(10235). Currently, only Action.Type.OfflineOData.UndoPendingChanges support this property. This property can't be used together with QueryOptions or ReadLink.

  • type: string

EntitySet

EntitySet name to use for this update entity operation

  • type: string

QueryOptions

String with query options like filter or Orderby to use to identify the entity. MUST resolve to a unique entity. Can't use together with ReadLink or EditLink.

  • type: string

Entity's Read Link. This is the entity ID path that uniquely identify the entity e.g. Product(10235). This property can't be used together with QueryOptions or EditLink.

  • type: string

ServerSidePaging

A property to specify if the Target service supports pagination via skipToken. If this property is set to true, then QueryOptions should not contain 'skip' and 'top' for pagination to work.

  • type: boolean
  • default: false

Service

The service to use for the update entity operation


UniqueIdType

Specifies the type of the Unique Id, MDK will wrap UniqueId(s) that are strings in ''.

  • type: enum

The value of this property must be equal to one of the known values below.

UniqueIdType Known Values

Value Description
Integer
String

Examples

Target Object

{
    "Target": {
      "EntitySet": "Orders",
      "Service": "/MDKOnline/Services/Online.service"
    }
}

Target with Object Binding

// {Addresses} is a binding that'll return an array of objects
{
    "Target": "{Addresses}"
}

// Complex type object binding with the use of array index that returns an object
{
    "Target": "{Output/Roles/1}"
}

Target with TargetPath

// {Addresses} is a binding that returns an array of objects
{
    "Target": "{Addresses}"
}
{
  "Target": {
    "EntitySet": "WorkOrderHeader",
    "Service": "/MyMDKApp/Services/MyOData.service",
    "ReadLink": "{@odata.readLink}"
  }
}
{
  "Target": {
    "EntitySet": "WorkOrderHeader",
    "Service": "/MyMDKApp/Services/MyOData.service",
    "EditLink": "{@odata.editLink}"
  }
}

Target with ServerSidePaging

// Specify the service supports pagination via skiptoken by setting ServerSidePaging to true.
{
    "Target": {
      "EntitySet": "FeedEntries",
      "Service": "/MDKOnline/Services/Jam.service",
      "ServerSidePaging": true,
    }
}

Escape TargetPath

// The string {#Control:Note/#Value} will be returned.
{
    "Value": "`{#Control:Note/#Value}`"
}