I have an array list that takes many ids. I am trying to get records with remote objects according to array list. I am using 'in' condition for this scenario and ı am getting an error that is "Invalid criteria specified for retrieval. ValidationError [code=11, message=Data does not match any schemas from "oneOf", path=/where, schemaKey=null]"

How can I solve this problem?

var icd10Data = new SObjectModel.icd10();

var gemList = ["a0Oi0000008z8OPEAY", "a0Oi000000E9twVEAR", "a0Oi0000008z8OPEAY"];           
icd10Data.retrieve({ where:{in:{Id: gemList }  } }, function(err, records){                                                   
                                                         if(err) alert(err.message);
                                                         else {


function populateIcd10(records) {
     records.forEach(function(record) {                 
         var toAddName = record.get("Name");
         var toAddId = record.get("Id");                 
         icd10ArrayList[toAddId] =toAddName;

Based on this Format and Options for Remote Objects Query Criteria documentation I think the first argument to the retrieve call should be:

{where: {Id: {in: gemlist}}}

However, it is important to note that you must also unique your array or you will get a similar error.

| improve this answer | |

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.