SQL

From MobileX for SageCRM
Revision as of 15:38, 10 November 2016 by Crmtogether (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

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);