Welcome to ExamTopics
ExamTopics Logo
- Expert Verified, Online, Free.
exam questions

Exam Certified Platform Developer II All Questions

View all questions & answers for the Certified Platform Developer II exam

Exam Certified Platform Developer II topic 1 question 81 discussion

Actual exam question from Salesforce's Certified Platform Developer II
Question #: 81
Topic #: 1
[All Certified Platform Developer II Questions]

What is a consideration when using bind variables with dynamic SOQL? (Choose two.)

  • A. Dynamic SOQL cannot reference fields on bind variables
  • B. Dynamic SOQL cannot use bind variables
  • C. Bind variables must be public or global
  • D. Bind variables must be in local scope
Show Suggested Answer Hide Answer
Suggested Answer: AD 🗳️

Comments

Chosen Answer:
This is a voting comment (?) , you can switch to a simple comment.
Switch to a voting comment New
code_breaker_27
1 year, 2 months ago
Selected Answer: AD
https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_dynamic_soql.htm Bind variable used in database.query makes use of :variablename format Needs to be local as seen in the example given.
upvoted 2 times
...
iValRV
1 year, 7 months ago
Selected Answer: AD
A and D is correct: "You can use simple bind variables in dynamic SOQL query strings when using Database.query" https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_dynamic_soql.htm
upvoted 1 times
...
Dev_Bond_ZA
1 year, 9 months ago
A and D is correct. 1. You can use simple bind variables in dynamic SOQL query strings when using Database.query' 2. However, unlike inline SOQL, you can’t use bind variable fields in the query string with Database.quer https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_dynamic_soql.htm
upvoted 1 times
Dev_Bond_ZA
1 year, 9 months ago
Also, D - local scope, is obviously correct because you will get an error otherwise.
upvoted 1 times
...
...
thneeb
1 year, 9 months ago
Selected Answer: AB
The referenced document of lorenac2 says that A and B is correct
upvoted 1 times
...
lorenac2
1 year, 10 months ago
For answers A/B: https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_dynamic_soql.htm For C/D: I don't have a reference, but as seen, the variables used in the example are not public or global but they do reside in the same class, hence, local. I can't find a better definition for 'local'.
upvoted 1 times
...
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.

Upvoting a comment with a selected answer will also increase the vote count towards that answer by one. So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.

SaveCancel
Loading ...