• mobile1.390759152613193E12
  • NEWBIE
  • 0 Points
  • Member since 2014

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 4
    Questions
  • 8
    Replies
Hi, I am receiving the following message when trying to create an Event fields throught the mobilesdk REST API:

{"errorCode":"JSON_PARSER_ERROR","message":"Cannot deserialize instance of date from VALUE_STRING value  at [line:1, column:32]"}]

It is using a patch call with the following payload:

Date__c: ""
Date_time__c: ""
EndDateTime: "2014-03-19T13:04:34.00Z"
OwnerId: "005E0000000eHwWIAU"
StartDateTime: "2014-03-19T13:04:30.00Z"
Subject: ""
WhatId: ""
WhoId: ""

Is this normal? How can I save a record with a date or datetime field with empty value?

Thanks for replying

Maurizio
Hi,

I am developing an hybrid app for iphone using the MockSmartStore (that personally I find fantastic! It saves you up a huge amount of time in debugging javascript).

I found a strange behaviour on smartQuery:

the following javascript line works when I make it run in the container:

return objectStructure.find({queryType:"smart", smartSql:"SELECT {objectStructure:_soup} FROM {objectStructure}", pageSize:25});

But when using MockSmartStore it gives me the following error:

Error caught when calling com.salesforce.smartstore:pgRunSmartQuery Error: SmartQuery not supported by MockSmartStore:SELECT {objectStructure:_soup} FROM {objectStructure} MockCordova.js:92
(anonymous function)

Error: SmartQuery not supported by MockSmartStore:SELECT {objectStructure:_soup} FROM {objectStructure}
    at module.smartQuerySoupFull (file:///Users/mauricapobianco/SalesforceMobileSDK-IOS2.1/mobile_sdk_samples/SFOfflineForIphone/test/MockSmartStore.js:292:19)
    at module.querySoupFull (file:///Users/mauricapobianco/SalesforceMobileSDK-IOS2.1/mobile_sdk_samples/SFOfflineForIphone/test/MockSmartStore.js:297:29)
    at module.querySoup (file:///Users/mauricapobianco/SalesforceMobileSDK-IOS2.1/mobile_sdk_samples/SFOfflineForIphone/test/MockSmartStore.js:340:32)
    at Object.com.salesforce.smartstore:pgRunSmartQuery (file:///Users/mauricapobianco/SalesforceMobileSDK-IOS2.1/mobile_sdk_samples/SFOfflineForIphone/test/MockSmartStore.js:402:32)
    at file:///Users/mauricapobianco/SalesforceMobileSDK-IOS2.1/mobile_sdk_samples/SFOfflineForIphone/test/MockCordova.js:90:46

The code in the two files are exactly the same, apart from the pointing to the aut_local.js and the pointing to the js libraries.

Thanks a lot for the help

Maurizio. 
I am having issues in makeing StoreCache.find() work on fields that are not the standard indexed (__loclal__, ID).

Here is how I setup the cache:

app.cacheContact = new Force.StoreCache("contacts", [ {path:"Account.Id", type:"string"} , {path:"LastName", type:"string"}]);

I assign it to the contact model:

model: app.models.Contact,
cache: function() { return app.cacheContact },

When I try to use the following query (inside a model):

return {type:"cache", cacheQuery:{queryType:"exact", indexPath:"Account.Id", matchKey:(this.key == null ? "" : this.key), order:"ascending", pageSize:25}}

I get the following error on the console:

DEBUG|SFSmartStore|Unknown index path 'Account.Id' in soup 'contacts'

I tried also to change the name of the field to AccountId. Same error happens If I use the field Email or Phone or any other.
find works only on the fields __local__, ID, and FirstName  (it doesn't work for LastName)... weird...

Thanks a lot for any help you could provide

Maurizio. 

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.
Hi, I am receiving the following message when trying to create an Event fields throught the mobilesdk REST API:

{"errorCode":"JSON_PARSER_ERROR","message":"Cannot deserialize instance of date from VALUE_STRING value  at [line:1, column:32]"}]

It is using a patch call with the following payload:

Date__c: ""
Date_time__c: ""
EndDateTime: "2014-03-19T13:04:34.00Z"
OwnerId: "005E0000000eHwWIAU"
StartDateTime: "2014-03-19T13:04:30.00Z"
Subject: ""
WhatId: ""
WhoId: ""

Is this normal? How can I save a record with a date or datetime field with empty value?

Thanks for replying

Maurizio
Hi,

I am developing an hybrid app for iphone using the MockSmartStore (that personally I find fantastic! It saves you up a huge amount of time in debugging javascript).

I found a strange behaviour on smartQuery:

the following javascript line works when I make it run in the container:

return objectStructure.find({queryType:"smart", smartSql:"SELECT {objectStructure:_soup} FROM {objectStructure}", pageSize:25});

But when using MockSmartStore it gives me the following error:

Error caught when calling com.salesforce.smartstore:pgRunSmartQuery Error: SmartQuery not supported by MockSmartStore:SELECT {objectStructure:_soup} FROM {objectStructure} MockCordova.js:92
(anonymous function)

Error: SmartQuery not supported by MockSmartStore:SELECT {objectStructure:_soup} FROM {objectStructure}
    at module.smartQuerySoupFull (file:///Users/mauricapobianco/SalesforceMobileSDK-IOS2.1/mobile_sdk_samples/SFOfflineForIphone/test/MockSmartStore.js:292:19)
    at module.querySoupFull (file:///Users/mauricapobianco/SalesforceMobileSDK-IOS2.1/mobile_sdk_samples/SFOfflineForIphone/test/MockSmartStore.js:297:29)
    at module.querySoup (file:///Users/mauricapobianco/SalesforceMobileSDK-IOS2.1/mobile_sdk_samples/SFOfflineForIphone/test/MockSmartStore.js:340:32)
    at Object.com.salesforce.smartstore:pgRunSmartQuery (file:///Users/mauricapobianco/SalesforceMobileSDK-IOS2.1/mobile_sdk_samples/SFOfflineForIphone/test/MockSmartStore.js:402:32)
    at file:///Users/mauricapobianco/SalesforceMobileSDK-IOS2.1/mobile_sdk_samples/SFOfflineForIphone/test/MockCordova.js:90:46

The code in the two files are exactly the same, apart from the pointing to the aut_local.js and the pointing to the js libraries.

Thanks a lot for the help

Maurizio. 

 I'm a bit confused about that statement in the Mobile Development guide:

 

"Developing a hybrid application inside the container requires a build/deploy step for every change. For that reason, we
recommend you develop your hybrid application directly in a browser, and only run your code in the container in the final
stages of testing. JavaScript development in a browser is easier because there is no build/compile step. Whenever you make changes to the code, you can refresh the browser to see your changes."

 

I assume this means setting up all the static resources within a VF page or an external web site for say, the AccountEditor app which I have working in the emulator? Is there an easy way to do this from forcedroid,  or some sample code?

Hi,

 

I'm using SmartStore in hybrid offline development. In online mode, I can do queries like:

Select Id,(select Id from Events),(select Id from Contacts) from Account

 But how to do this with SmartStore using smart queries ?

 

 

 

  • November 19, 2013
  • Like
  • 0