Salesforce
PDII · Question #84
Which statement is true regarding the use of user input as part of a dynamic SOQL query?
The correct answer is C. Quotes should be escaped to protect against SOQL injection. See the full explanation below for the reasoning.
Question
Which statement is true regarding the use of user input as part of a dynamic SOQL query?
Options
- AFree text input should not be allowed, to avoid SOQL injection
- BThe String.format() method should be used to prevent injection
- CQuotes should be escaped to protect against SOQL injection
- DThe string should be URL encoded by the input form to prevent errors
How the community answered
(47 responses)- A4% (2)
- B11% (5)
- C83% (39)
- D2% (1)
Community Discussion
No community discussion yet for this question.