Query filter in javascript sdk


#1

Hello, I’m trying to figure out how to make an AND sql filter in a query in javascript in a deleteRecord.

So far I have tried : var params = ‘filter=userid%3D’+id + '&filter=batch%3D '+1;

This seem to target userid or batch in a delete call, I want userid AND batch. How do I write that ?

Thanks


#2

if this is 1.x, try
'filter=userid%3D' + id + ' AND batch%3D' + 1

in 2.x the conditions need to be in parentheses
'filter=(userid%3D' + id + ') AND (batch%3D' + 1 + ')'


#3

@Mathieu_Gauthier, the response from @drewpearce is concise and precise, and you can find more information in the docs: http://wiki.dreamfactory.com/DreamFactory/Tutorials/Querying_records_with_logical_filters