Hi
I have the following:
recd.selectQry = 'select Account.Id from Account where Account.Id IN ('87654321')';
How can i format this / escape the single quotes in javascript before sending to the sql server ?
thanks
Hi robby32,
In JS, we can use backslash (\) as escape character. Please refer to: https://www.w3schools.com/js/js_strings.asp.
In your case,
<script> var selectQry = 'select Account.Id from Account where Account.Id IN (\'87654321\')'; alert(selectQry); </script>
The result:
Best Regard,
Yang Shen
or the simple:
recd.selectQry = "select Account.Id from Account where Account.Id IN ('87654321')";