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 54 discussion

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

A company has a web page that needs to get Account record information, given its Salesforce record ID, from JavaScript on the page and then display it.
Which method of integration is optimal?

  • A. REST API
  • B. Apex SOAP Web Service
  • C. Soap API
  • D. Apex REST Web Service
Show Suggested Answer Hide Answer
Suggested Answer: A 🗳️

Comments

Chosen Answer:
This is a voting comment (?). It is better to Upvote an existing comment if you don't have anything to add.
Switch to a voting comment New
nibbio
Highly Voted 3 years, 4 months ago
REST API is more than enough to get the Account information by its ID, there is no need to expose a REST WEB SERVICE from Salesforce
upvoted 13 times
...
BrainMelt12
Most Recent 1 month, 1 week ago
Selected Answer: D
D is correct: The requirement is to fetch Account record information from JavaScript on a web page, which means the request will be made from a client-side script (JavaScript). Apex REST Web Service allows the creation of custom REST endpoints in Salesforce using Apex. JavaScript can easily call an Apex REST Web Service using AJAX or Fetch API. A can be done but it's not optimal. While Salesforce provides a standard REST API, it requires authentication via OAuth, which can be complex to handle in JavaScript running in a browser. Apex REST allows more control and customization. The key difference between D vs A is control and authentication complexity. Due to the complexity of authentication via JavaScript, D is the optimal answer.
upvoted 1 times
...
gsori
8 months, 3 weeks ago
Selected Answer: D
I'd say D https://trailhead.salesforce.com/content/learn/modules/apex_integration_services/apex_integration_webservices "By making your methods callable through the web, your external applications can integrate with Salesforce to perform all sorts of nifty operations." A web page that needs to retrieve account info from SF sounds like an external application to me,
upvoted 1 times
...
thneeb
2 years, 2 months ago
Selected Answer: A
A, the ootb REST API can be used
upvoted 3 times
...
lorenac2
2 years, 3 months ago
Selected Answer: A
I said D myself, but I think the confusion comes from that cast that I thought 'Rest API' implied that Salesforce was using a callout to an external service whereas the external service is using the API (without a custom class) to get the information. The reason why it mentions Javascript is because REST supports JSON whereas SOAP does not, it only supports XML.
upvoted 4 times
...
amilaveer
2 years, 4 months ago
Selected Answer: A
REST API is enough
upvoted 3 times
...
Ronin192
2 years, 5 months ago
Answer is A. Apex REST Web Service is only used if you need to perform custom logic.
upvoted 1 times
...
nkarmi
2 years, 5 months ago
The correct is A you don't need to expose the apex rest service and write a test class for just retrieving an account, just call a rest API https://developer.salesforce.com/docs/atlas.en-us.api_rest.meta/api_rest/dome_get_field_values.htm
upvoted 1 times
...
levian
2 years, 6 months ago
Correct is D, because its a call from web to SF. If it was a call from SF to web, it woud be A
upvoted 3 times
...
OmShantiVeg
2 years, 9 months ago
Correct is D because from the web page you need to access Sf
upvoted 4 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 ...
exam
Someone Bought Contributor Access for:
SY0-701
London, 1 minute ago