SQL

From MobileX for SageCRM

This is an example of using SQL in a query and getting JSON back

 var visitId = SQLJSONSerializer.InsertOrUpdateRecord("Visit", visitJSON, "vsit_visitid",
 visit.vsit_visitid ? "vsit_visitid" : null);
 SQLJSONSerializer.ExecSQL(sql);
 var sql = "select * " +
       " from library " +
       " where {0}={1} order by 1 desc";
 sql = clr.System.String.Format(sql, libridfield, params.EntityId);
 var jsonResult = SQLJSONSerializer.ExecuteQueryToJSON(sql, false);
 Response.Write(jsonResult);