Question 251 · 279 in bank
A developer is working on code that requires a call to an external web service from a batch. How should the developer enable this functionality?
Show answer
Answer: B
Salesforce Certified Platform Developer II279 questions across 28 pages are complete and free, with no account or card.
279 questions in this bank
Free access · progress saved on this device
A developer is working on code that requires a call to an external web service from a batch. How should the developer enable this functionality?
Answer: B
A developer must create a custom pagination solution for accessing approximately 2000 records and displaying 50 records on each page. Data from Salesforce will be accessed via an API and not via Apex. How can the developer meet these requirements? (Choose two.)
Answer: CD
I would approach it this way. Assume you are querying a different Salesforce org using an API instead of querying directly such as in this example. https://eshopsync.com/how-to-fetch-records-through-rest-api-in-apex-class-salesforce/. That said, the query would be built the same way. So here are the references. Offset: https://developer.salesforce.com/docs/atlas.en-us.soql_sosl.meta/soql_sosl/sforce_api_calls_soql_select_offset.htm Rest API Query: https://developer.salesforce.com/docs/atlas.en-us.api_rest.meta/api_rest/using_resources_working_with_searches_and_queries.htm
Source: Adapted from community discussion — lorenac2
A developer must create a way for external partners to submit millions of leads into Salesforce per day. How should the developer meet this requirement?
Answer: B
It's possible that B is definitely correct: "The most common use case with Heroku and Salesforce is to provide a high-throughput, low-latency interface for customer-facing applications built with open-source technologies." Source: https://trailhead.salesforce.com/content/learn/modules/salesforce_heroku_integration/getting_started_with_integration In 2023, it's more likely it will ask about Mulesoft than Heroku, or at least equal to.
Source: Adapted from community discussion — lorenac2
Which is a valid Apex REST Annotation? (Choose two.)
Answer: AB
A customer requires that when the billing address field on an Account gets updated, the address field on all its related contact records should reflect the same update. How can this requirement be met with minimal customizations?
Answer: C
I looked up the term and apparently is used to be called "Lightning Process Builder" https://www.grazitti.com/blog/what-is-salesforces-lightning-process-builder/. The answer is C (and today, the answer is flow). A uses code, and D is worse XD. Workflow can only update the same record, and sometimes the parent, but never children.
Source: Adapted from community discussion — lorenac2
A company requires an external system to be notified whenever an account is updated. trigger AccountTrigger on Account (after update){ for (Account updatedAccount:Trigger.new) { AccountTriggerHelper.notinyxternalSystem(updatedAccount.id); } } public class AccountTriggerHelperfuture(callout=true) { public static void notinyxternalSystem(Id accountId){ Account acc = [Select id, name from Account where accountId = :accountId]; http objectHttp h = new Http(); HttpRequest req = new HttpRequest(); req.setEndpoint('http://example.org/ restService'); req.setMethod('POST'); req.setBody(JSON.serialize(acc)); HttpResponse res = h.send(req); } } What LimitException could the following code trigger?
Answer: A
So it was fun pulling this apart to be able to read it. Yes, it is written incorrectly. The 'callout=true' is on the wrong line is missing @future. I filled in the gap knowing the intention. So let's look at the governor limits and see what hits first. SOQL Query: 100 per transaction Callouts: 100 per transaction @future: 50 per transaction The too many future callouts hits first, hence A. THAT is what this question is asking about. In reality, as is, I don't believe the code will even compile. Reference: https://developer.salesforce.com/docs/atlas.en-us.salesforce_app_limits_cheatsheet.meta/salesforce_app_limits_cheatsheet/salesforce_app_limits_platform_apexgov.htm
Source: Adapted from community discussion — lorenac2
A developer is using a third-party JavaScript library to create a custom user interface in Visualforce. The developer needs to use JavaScript to get data from a controller method in response to a user action. How can the developer accomplish this?
Answer: B
Answer B Javascript remoting is correct as actionSupport does not provide javascript support. It calls the controller method directly for the selected user action.
Source: Adapted from community discussion — ajithk47
A developer created and tested a Visualforce page in their developer sandbox, but now receives reports that users are encountering ViewState errors when using it in Production. What should the developer ensure to correct these errors?
Answer: B
If users see a ViewState error it means that they have been able to access the visualforce, therefore their profile has access, option D is not correct. The correct option is B.
Source: Adapted from community discussion — santo_aj
A company exposes a REST web service and wants to establish two-way SSL between Salesforce and the REST web service. A certificate signed by an appropriate certificate authority has been provided to the developer. What modification is necessary on the Salesforce side? (Choose two.)
Answer: AB
What is a consideration when using bind variables with dynamic SOQL? (Choose two.)
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.
Source: Adapted from community discussion — code_breaker_27
Keyboard:J Kmove between questionsA–Dselect an answerRshow or hide the answer← →change page
PD2 practice, question 251. 279 questions available.
Version 1.0.0. How we source questions