Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    customSQL with JavaScript variables ?

    Hi,
    we are evaluating Smartclient 8.2.
    We added a customSQL clause to the datasource description, for calling stored procedures for all operationTypes.
    This works fine when the parameters of the stored procedure can be built with $criteria or $values.
    But, how can we address a JavaScript variable in a customSQL clause?
    Thank you for help.
    John

    #2
    SQL is formed on the server and does not have access to JavaScript. If you have additional data in the browser that you want to use in SQL generation, pass it as part of dsRequest.data.

    Comment


      #3
      Originally posted by Isomorphic
      SQL is formed on the server and does not have access to JavaScript. If you have additional data in the browser that you want to use in SQL generation, pass it as part of dsRequest.data.
      Thanks a lot. We added an "extra column" to the updated record before execution of updateData(). So we can pass it via $values.spr_id to the stored procedure call.
      John

      Code:
      updatedRecord = isc.addProperties(updatedRecord, {spr_id:47});   
      ListGrid1.updateData(updatedRecord);

      Comment

      Working...
      X