I have an issue with remote objects: I run the following code:

<apex:remoteObjectModel name="Case" jsShorthand="case" 

    var cases = new SObjectModel.Case();
    cases.retrieve({where: {IsClosed: {eq: false}}}
    , function(error, records) {

and the error is:

Error occurred while performing RETRIEVE operation on sobject: Case with data: {where={IsClosed={eq=true}}} (MALFORMED_QUERY: 
subject, createddate, id, casenumber, _cid FROM Case WHERE IsClosed =
ERROR at Row:1:Column:76
line 1:76 no viable alternative at character '_') 

Well, yesterday it was working ok. What can be wrong with this part?


I couldn't find much detail in the "official" documentation, but did come across this gist that illustrates many patterns.

The only "query by a specific id" pattern I could get to work is this one:

<apex:page >
        <apex:remoteObjectModel name="Account" jsShorthand="Account" fields="Name,Id"/>
        fetch = function(){
            var a = new SObjectModel.Account();
            a.retrieve({where: {Id: {eq: "001i000000cwvW9AAI"}}}, function(err, records){
                if(err) alert(err.message);
                else {
                    records.forEach(function(record) {
    <button onclick="fetch()">Fetch</button>

which is like your first example except that it works... Your error message doesn't seem to reflect the "where" that you list; is it possible some other code is causing your error?

  • As I said it was working ok a day before
    – Natallia
    May 21 '14 at 7:08

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.