I have a data source with a custom <selectClause> in the ds.xml file. I'm using DataSource.fetchData and passing it an AdvancedCriteria object that I've created with this code.
The SQL statement that gets logged to the console shows the SELECT statement with WHERE ('0'='1') instead of the criteria I passed it. Here is the DSRequest that shows up in the developer console.
I was expecting to see a WHERE ISKU IN (21949, 21956). If I change the criteria to be a simple ISKU equals 21949 condition it works. Is there a problem with the IN_SET operator?
Code:
AdvancedCriteria selectionCriteria = new AdvancedCriteria("ISKU", OperatorId.IN_SET); ArrayList<Integer> skus = new ArrayList<Integer>(); for (ListGridRecord rec : itemGrid.getSelection()) { skus.add(rec.getAttributeAsInt("ISKU")); } Integer ia[] = new Integer[skus.size()]; selectionCriteria.addCriteria("ISKU", skus.toArray(ia));
Code:
{ dataSource:"ItemSummary", operationType:"fetch", data:{ fieldName:"ISKU", operator:"inSet", ISKU:[ 21949, 21956 ] }, showPrompt:true, requestId:"ItemSummary$62721", bypassCache:true, oldValues:{ fieldName:"ISKU", operator:"inSet", ISKU:[ 21949, 21956 ] } }
Comment