Mobile Sync wraps the SOSL query you provide as a REST request and sends it to Salesforce.
Configuration File Usage
For the "target" property, specify the following values.
Target Properties
-
"type":"sosl"
- :
-
"query": <string>
- : The SOSL query.
-
"idFieldName": <string>
- : (Optional) Name of a custom ID field. If you provide
"idFieldName", Mobile Sync uses the field with the given name to get the ID of the record. For example, if you specify"idFieldName":"AcmeId", Mobile Sync obtains the record’s ID from theAcmeIdfield instead of the defaultIdfield.
- : (Optional) Name of a custom ID field. If you provide
-
"modificationDateFieldName": <string>
- : (Optional) Name of the field containing the last modification date for the record. If you provide
modificationDateFieldName, Mobile Sync uses the field with this name to compute themaxTimestampvalue thatstartFetchuses to resync the records. Default field name islastModifiedDate.
- : (Optional) Name of the field containing the last modification date for the record. If you provide
iOS APIs
These factory methods create a SOSL sync down target that defines the "query" property. To specify the optional "idFieldName" and "modificationDateFieldName" properties, set their superclass members on the returned target.
-
Swift
-
: Class:
SoslSyncDownTargetSoslSyncDownTarget.newSyncTarget(_ query:String) → Self
-
-
Objective-C
-
: Class:
SFSoslSyncDownTarget+ (SFSoslSyncDownTarget*) newSyncTarget:(NSString*)query;
-
Android APIs
These factory methods create a SOSL sync down target that contains the "query" property. To specify the optional "idFieldName" and "modificationDateFieldName" properties, set their superclass members on the returned target.
-
Kotlin
-
: Class:
SoslSyncDownTargetpublic fun SoslSyncDownTarget(query: String)
-
-
Java
-
: Class:
SoslSyncDownTargetpublic SoslSyncDownTarget(String query)
-
Example
{
"syncs": [
{
"syncName": "syncDownAcme",
"syncType": "syncDown",
"soupName": "contacts",
"target": {"type":"soql", "query":"FIND 'Acme' IN ALL FIELDS RETURNING Account(Name),
Contact(FirstName,LastName)"},
"options": {"mergeMode":"OVERWRITE"}
}
]
}