Certified Platform Developer II Practice Test practice questions, page 16 of 17, with answer review and explanations.
Question 76
Which is a valid Apex REST Annotation? (Choose two.)
@HttpPatch
@HttpDelete
@HttpUpsert
@HttpAction
Question 77
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?
Create an After Trigger on Account to update its related contact records on update
Create a Workflow Rule on Account to update related child Contact records
Create a Lightning Process on Account to update related child Contact records
Create a scheduled batch job that updates all contact address fields based on the related account record
Question 78
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?
System.LimitException: Too many future calls
System.LimitException: Too many callouts
System.LimitException: Too many SOQL queries
System.CalloutException: Callout from triggers are currently not supported
Question 79
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?
Use <apex:actionFunction> to create a JavaScript wrapper for the controller method
Use the @RemoteAction annotation on the method definition with JavaScript Remoting
Use the $Controller global variable to access the controller method via JavaScript
Use <apex:actionSupport> to enable JavaScript support for the controller method
Question 80
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.)
Create an entry for the certificate in Certificate and Key Management
Update the code to use HttpRequest.setClientCertificateName()
Configure two-factor authentication with the provided certificate
Update the code to use HttpRequest.setHeader() to set an Authorization header