Quantcast
Channel: SmartClient Forums
Viewing all articles
Browse latest Browse all 4756

updateData & Custom Criteria

$
0
0
I have a situation where I want to to run an update on all records in a grid that match the current criteria.

I've tried creating it like this:
Code:

<operationBinding operationType="update" operationId="replace" allowMultiUpdate="true">
  <customSQL>
      UPDATE MYTABLE
      SET $defaultValuesClause
      WHERE MYTABLE_ID IN (
        SELECT MYTABLE_ID FROM
        getValues($advancedCriteria.DATABASE_ID) MYTABLE
        WHERE $defaultWhereClause AND EDITABLE = 1
      )
</customSQL>
</operationBinding>

On the javascript side, I call:
Code:

ds.updateData({"FIELD":"NEW_VALUE"},null,{operationId:'replace',criteria:myGrid.getCriteria()});
The query that's output in the logs server side looks right, except it doesn't see my criteria at all (and it's there, if I do an isc.say(JSON.stringify(myGrid.getCriteria())); it looks just fine).

I get this on the console:
SQLDataSource - [builtinApplication.replace] Performing update operation with
criteria: {} values: {FIELD:"NEW_VALUE"}

and so getValues(null) returns nothing, and nothing gets updated.

Is there any way I get updateData to see my criteria?

SmartClient Version: v9.0p_2013-08-02/PowerEdition Deployment

User-Agent: User-Agent: 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_8_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/28.0.1500.95 Safari/537.36': Safari with Accept-Encoding header

Viewing all articles
Browse latest Browse all 4756

Trending Articles