+ Start a Discussion
mobile1.390759152613193E12mobile1.390759152613193E12 

Mobile SDK 2.1 Force.StoreCache("contacts") can't query on the AccountId field.

I have a problem with SmartQuery using Smartstore Offline.
I am using mobile SDK 2.1 and I am extending the AccountEditor application.
I am trying to run a smartQuery to get from Offline Smartstore all the contacts of that particolar Account. I arrive to run the following smartQuery:

smartSql = "SELECT {contacts:_soup} FROM {contacts} WHERE {contacts:AccountId} IN ( '001E000000Hl5XEIAZ') ORDER BY LOWER({contacts:Id})";

Here is the fieldlist of my contact Collection Model: fieldlist: ["Id","AccountId","FirstName","LastName", "Phone", "Email","Birthdate","Owner.Name", "LastModifiedBy.Name", "LastModifiedDate"],

I have inlcuded the field in the Index Path at initialization:
app.cacheContact = new Force.StoreCache("contacts", [ {path:"AccountId", type:"string"} ]);

If I change the contacts:AccountId with contacts:FirstName, I don't get the error any more, but Of course I don't obtain the result I want.

Please help

Thanks a lot

Maurizio.
akhilesh_sfdcakhilesh_sfdc
Responded on the other thread.