Trying to get Parent/Children - related record syncing working in a salesforce mobile sdk (version 7.0.0) iOS app. I'm receiving errors when the system attempts to build the syncs.

Here's what I've tried so far: Created a new app using forceios, template SmartSyncExplorerSwift#v7.0.0.

Added the content from the salesforce documentation on Syncing Related Record to the userstore and usersyncs files. here's a link to the documentation/example I am referring to https://developer.salesforce.com/docs/atlas.en-us.mobile_sdk.meta/mobile_sdk/entity_framework_sync_related.htm

Ran the app. The soups get created successfully When the system tries to build the syncs, it fails with the following message: [SmartSync] CLASS: SFSDKSyncsConfig Creating sync: (null)

Added the syncName key/value to the sync definition.

Ran the app and when the system tries to build the syncs, it now fails with the following message: Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '*** -[__NSPlaceholderDictionary initWithObjects:forKeys:count:]: attempt to insert nil object from objects[2]'

Looking at the code in the sdk file SFSDKSyncsConfig.m, it looks like the creation of the syncs is failing because the syncType key is missing.

Added the syncType key/value and tried running the app again. This time it fails with the message:

SFSyncDownTarget newFromDict: Custom class name not specified.

I checked the code in SFSyncDownTarget, and the only way to get to that message in the function is if there isn't a value in the iOSImpl key or the value of the type key cannot be located. The configuration copied from the documentation has an iOSImpl and type key/value:

"iOSImpl" : "SFParentChildrenSyncDownTarget", and "type": "parentChildren",

Here's the changes I made to the usersyncs from the SFDC example: "syncName": "syncDownParentChild", "syncType": "syncDown",

I was hoping that I could copy an example from the developer documentation into a new/clean project, get it working quickly, learn something and move on to bigger and better things, but hours later I'm still struggling to get this simple example working. Any idea what I am doing wrong here? Are there any working examples of configuring smartsync for related records? I've searched everywhere I can think of without success.

For now I am stuck here when I try and run the project: SFSyncDownTarget newFromDict: Custom class name not specified.

1 Answer 1


What was causing the error was not populating the server Id fields in the local storage. Once I set the Id on the parent record and the Id on the child record as well as the ParentId on the child, everything started to work. I just populated the field with "New" + current date time.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .