You need to sign in to do that
Don't have an account?
Vinod Vishwakarma
Smartstore Syncdown Issue In Android Native App Using SyncManager
Hi SFDC Team,
I have created the soup in my native android app. the soup created successfully but when i am trying to sync down the data from serve to local it says this error : com.salesforce.androidsdk.smartstore.store.SmartSqlHelper$SmartSqlException: tm_accounts does not have an index on __local__ at character 49
tm_accounts -> this is my soup name
code snippet.
private void syncDownTMAccount() {
SyncDownTarget target = new SoqlSyncDownTarget("SELECT product_amount__c, tm_type__c, Date__c, tm_phone__c FROM "+SoupName.TMACCOUNT_SOUP__);
try {
DebugLog.d("SyncDownTarget=="+target.asJSON());
SyncManager.getInstance().syncDown(target, options, SoupName.TMACCOUNT_SOUP, new SyncManager.SyncUpdateCallback() {
@Override
public void onUpdate(SyncState sync) {
try {
sync.save(mSmartStore);
DebugLog.d("Sync Down updated");
} catch (JSONException e) {
e.printStackTrace();
}
}
});
} catch (JSONException e) {
Log.e(TAG, "JSONException occurred while parsing", e);
}
}
When i call this method below error comes. Can any one help me that.
com.salesforce.androidsdk.smartstore.store.SmartSqlHelper$SmartSqlException: tm_accounts does not have an index on __local__ at character 49
I have created the soup in my native android app. the soup created successfully but when i am trying to sync down the data from serve to local it says this error : com.salesforce.androidsdk.smartstore.store.SmartSqlHelper$SmartSqlException: tm_accounts does not have an index on __local__ at character 49
tm_accounts -> this is my soup name
code snippet.
private void syncDownTMAccount() {
SyncDownTarget target = new SoqlSyncDownTarget("SELECT product_amount__c, tm_type__c, Date__c, tm_phone__c FROM "+SoupName.TMACCOUNT_SOUP__);
try {
DebugLog.d("SyncDownTarget=="+target.asJSON());
SyncManager.getInstance().syncDown(target, options, SoupName.TMACCOUNT_SOUP, new SyncManager.SyncUpdateCallback() {
@Override
public void onUpdate(SyncState sync) {
try {
sync.save(mSmartStore);
DebugLog.d("Sync Down updated");
} catch (JSONException e) {
e.printStackTrace();
}
}
});
} catch (JSONException e) {
Log.e(TAG, "JSONException occurred while parsing", e);
}
}
When i call this method below error comes. Can any one help me that.
com.salesforce.androidsdk.smartstore.store.SmartSqlHelper$SmartSqlException: tm_accounts does not have an index on __local__ at character 49
Just add the below code in your index specs
new IndexSpec(SyncManager.LOCALLY_CREATED, SmartStore.Type.string),
new IndexSpec(SyncManager.LOCALLY_UPDATED, SmartStore.Type.string),
new IndexSpec(SyncManager.LOCALLY_DELETED, SmartStore.Type.string),
new IndexSpec(SyncManager.LOCAL, SmartStore.Type.string)