Preparing Practice Exam…
Please wait a moment while the system generates the exam questions, answers, and study session.
Please wait a moment while the system generates the exam questions, answers, and study session.
Question 50 of 83
Free Preview · 83 of 275 · questions 1–83 of 275 are free. Sign up free to sync your progress across devices.
Select one answer.
Written by other learners. Comments can disagree with the marked answer — check the official documentation when in doubt.
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.
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,
A, the ootb REST API can be used