Soql String Escaping And Reserved Characters

Use when a SOQL single-quoted string literal contains a character that must be escaped: an apostrophe in a name (O'Brien, Bob's BBQ), a backslash, a tab/newline/other control character, a Unicode character via \uXXXX, or a literal LIKE wildcard (\_ or \%). Covers the backslash escape character, the full quoted-string escape-sequence table, the two reserved characters (single quote and backslash) that must always be escaped, the LIKE-only \_ / \% wildcard escapes, the hard-error rule for any other backslash use, and String.escapeSingleQuotes on the Apex side. NOT for binding untrusted input into dynamic SOQL — use apex/apex-dynamic-soql-binding-safety. NOT for SOQL-injection review or CRUD/FLS enforcement — use apex/soql-security. NOT for Apex String/regex methods — use apex/apex-string-and-regex.

PranavNagrecha 5d8709b 7 files · 38.4 KB Updated 15 repo stars

File contents

PranavNagrecha/AwesomeSalesforceSkills/tree/main/skills/apex/soql-string-escaping-and-reserved-characters commit 5d8709ba0c

Frequently asked questions

npx skillmds add pranavnagrecha/soql-string-escaping-and-reserved-characters