Using the MRU Sync Down Target

To retrieve the most recently viewed records for a specific Salesforce object in your org, use the MRU sync down target.

The MRU sync down target returns only the most recently viewed records for the given object, as determined by the Salesforce API.

Configuration File Usage 

For the "target" property, specify the following values.

Target Properties 

"type":"mru"

"fieldList": Array of <string>

List of fields to sync.

"objectType": <string>

Name of a Salesforce object.

iOS APIs 

Swift

Class: MruSyncDownTarget

1MruSyncDownTarget.newSyncTarget(objectType: String, fieldlist: [Any])
Objective-C

Class: SFMruSyncDownTarget

1+ (SFMruSyncDownTarget*) newSyncTarget:(NSString*)objectType fieldlist:(NSArray*)fieldlist;

Android APIs 

Kotlin

Class: MruSyncDownTarget

1public MruSyncDownTarget(fieldlist: List<String>, objectType: String)
Java

Class: MruSyncDownTarget

1public MruSyncDownTarget(List<String> fieldlist, String objectType)

Example 

1{
2  "syncs": [
3    {
4      "syncName": "syncDownMruContacts",
5      "syncType": "syncDown",
6      "soupName": "contacts",
7      "target": {
8        "type": "mru",
9        "fieldlist": [
10          "FirstName",
11          "LastName",
12          "Title",
13          "MobilePhone",
14          "Email",
15          "Department",
16          "HomePhone"
17        ],
18        "object": "Contact"
19      },
20      "options": { "mergeMode": "OVERWRITE" }
21    },
22    {
23      "syncName": "syncUpContacts",
24      "syncType": "syncUp",
25      "soupName": "contacts",
26      "target": {
27        "createFieldlist": [
28          "FirstName",
29          "LastName",
30          "Title",
31          "MobilePhone",
32          "Email",
33          "Department",
34          "HomePhone"
35        ]
36      },
37      "options": {
38        "fieldlist": [
39          "Id",
40          "FirstName",
41          "LastName",
42          "Title",
43          "MobilePhone",
44          "Email",
45          "Department",
46          "HomePhone"
47        ],
48        "mergeMode": "LEAVE_IF_CHANGED"
49      }
50    }
51  ]
52}

We've Moved

Welcome to the new home of the Mobile SDK Developer Guide! For now, the Japanese guide can be found in PDF form.