queryExpression = queryExpression + customLayer.layerDetails.fields[3].name + " like '%" + obj.name + "%'"+" OR " if(queryExpression.length > 4) { queryExpression = queryExpression.substring(0,queryExpression.length - 4); } customLayer.definitionExpression = queryExpressionSolved! Go to Solution.
queryExpression = customLayer.layerDetails.fields[3].name + " IN (1,2,3,4,5,6,7,8,9,10)";
Faizan,
I do believe that you should still attempt to use the IN operator. Just loop through all your results creating a comma separated list and then when you are done looping add the list to the SQL expression using the IN operator. I believe that you will find that the resulting SQL Expression will function better. So did you figure out how to escape your single quote in the data?
value = value.replace("'","''");