DON'T WANT TO MISS A THING?

Certification Exam Passing Tips

Latest exam news and discount info

Curated and up-to-date by our experts

Yes, send me the newsletter

Salesforce Platform Developer II Exam Questions and Answers PDF | SPOTO

SPOTO's latest exam dumps on the homepage, with a 100% pass rate! SPOTO delivers authentic Cisco CCNA, CCNP study materials, CCIE Lab solutions, PMP, CISA, CISM, AWS, and Palo Alto exam dumps. Our comprehensive study materials are meticulously aligned with the latest exam objectives. With a proven track record, we have enabled thousands of candidates worldwide to pass their IT certifications on their first attempt. Over the past 20+ years, SPOTO has successfully placed numerous IT professionals in Fortune 500 companies.
Take other online exams

Question #1
A Visualforce page contains an industry select list and displays a table of Accounts that have a matching value in their Industry field. When a user changes the value in the industry select list, the table of Accounts should be automatically updated to show the Accounts associated with the selected industry. What is the optimal way to implement this?
A. Add an within the
B. Add an within the
C. Add an within the
D. Add an within the
View answer
Correct Answer: B
Question #2
What should be added to the setup, in the location indicated, for the unit test above to create the controller extension for the test? A) B) C) D)
A. Option A
B. Option B
C. Option C
D. Option Dcorrect
View answer
Correct Answer: D
Question #3
A developer is asked to create a Lightning web component that will be invoked via button on a record page. The component must be displayed in a model dialog. Which three steps should the developer take to achieve this? Choose 3 answers
A. Add a tarqetConfig anf set targets to lightning_RecordAction
B. In targetConfigs, add Lightning_Apppage as a target
C. Set action Type to screenAction
D. In target, add lightning_RecordAction as a target
E. Set eventType to action
View answer
Correct Answer: ACD
Question #4
Sometimes events on Salesforce need to be handled by an external system due to the scale or type of process being executed. Consider the use case of a user in Salesforce needing to get pricing for an order they are building in Salesforce while on the phone with a customer. The pricing logic already exists in a third-party system. Instead of recreating this logic in Salesforce, it will be leveraged by making a request of the third-party system. The response, in this case the pricing, will be returned and sto
A. A Visualforce page that can make a real-time Apex callout to display and save the pricing back in Salesforce
B. An Apex trigger that upon saving the Order will make a real-time Apex callout, saving the pricing back in Salesforcecorrect
C. A Process Builder process and Outbound Message to fetch the pricing upon save and store the pricing in Salesforce
D. An ETL tool to process batches of newly saved Orders every few minutes to store the pricing back in Salesforce
View answer
Correct Answer: B
Question #5
A business requires that every parent record must have a child record. A developer writes an Apex method with two DML statements to insert a parent record and a child record. A validation rule blocks child records from being created. The method uses a try/catch block to handle the DML exception. What should the developer do to ensure the parent always has a child record?
A. Use Database
B. Use addError () on the parent record if an error occurs on the child record
C. Set a database savepoint to rollback if there are errors
D. Delete the parent record in the catch statement when an error occurs on the child record DML operation
View answer
Correct Answer: C
Question #6
A Visualforce page loads slowly due to the large amount of data it displays.Which strategy can a developer use to improve the performance?
A. Use Javascript to move data processing to the browser instead of the controller
B. Use the transient keywords for the List variables used in the custom controller
C. Use lazy loading to load the data on demand, instead of the controller's constructor
D. Use an in the page to load all of the data asynchronously
View answer
Correct Answer: B
Question #7
Universal Containers wants to use an external Web Service provided by a third-party vendor to validate that shipping and billing addresses are correct. The current vendor uses basic password authentication, but Universal Containers might switch to a different vendor who uses OAuth. What would allow Universal Containers to switch vendors without updating the code to handle authentication?
A. Custom Metadata
B. Custom Setting (List)
C. Dynamic Endpoint
D. Named Credential
View answer
Correct Answer: D
Question #8
There are user complaints about slow render times of a custom data table within a Visualforce page that loads thousands of Account records at once. What can a developer do to help alleviate such issues?
A. Upload a third-party data table library as a static resource
B. Use JavaScript remoting to query the accounts
C. Use the standard Account List controller and implement pagination
D. Use the transient keyword in the Apex code when querying the Account records
View answer
Correct Answer: C
Question #9
A developer has a requirement to query three fields (Id, Name, Type) from an Account; and first and last names for all Contacts associated with the Account.Which option is the preferred, optimized method to achieve this for the Account named 'Ozone Electronics'?A)B)D)
A. Option A
B. Option B
C. Option C
D. Option D
View answer
Correct Answer: C
Question #10
Given the following information regarding Universal Containers (UC): ? UC represents their customers as Accounts in Salesforce ? All customer has a unique Customer-Number- c, that is unique across all of UC's systems. ? UC also has a custom Invoice_ c object, with a Lookup to Account, to represent invokes that are sent out from their external system UC wants to integrate invoice data back into Salesforce so Sales Reps can see when a customer pays their bills on time. What is the optimal way to implement thi
A. Option A
B. Option Bcorrect
C. Option C
D. Option D
View answer
Correct Answer: B
Question #11
An Apex class does not achieve expected code coverage. The testSetup method explicitly calls a method in the Apex class. How can the developer generate the code coverage?
A. Verify the user has permissions passing a user into System
B. Call the Apex class method from a testMethod instead of the testSetup method
C. Add @testVisible to the method in the class the developer is testing
D. Use system
View answer
Correct Answer: B
Question #12
A developer created a Lightning web component that uses a Lightning-record-edit-force to collect information about Leads. Users complain that they only see one error message at a time when they save a Lead record. What can the developer use to perform the validations, and allow multiple error messages to be displayed simultaneously?
A. Apex REST
B. External JavaScript Librarycorrect
C. Apex Trigger
D. Process Builder
View answer
Correct Answer: B
Question #13
A developer needs to send Account records to an external system for backup purposes. The process must take a snapshot of Accounts as they are saved and then make a callout to a RESTful web service. The web service can only receive, at most, one record per call.What should a developer do to implement these requirements?
A. Implement the Queveable interface
B. Implement platform events
C. Expose an Apex class as e web service
D. Create a future method
View answer
Correct Answer: C
Question #14
What is the transaction limit for the number of records per DML statement?
A. 5,000
B. 20,000
C. 50,000
D. 10,000
E. There is no limit
View answer
Correct Answer: D
Question #15
Refer to the Lightning component below: The Lightning Component allows users to click a button to save their changes and then redirects them to a different page. Currently when the user hits the Save button, the records are getting saved, but they are not redirected. Which three techniques can a developer use to debug the JavaScript? Choose 3 answers
A. Use the browser's dev tools to debug the JavaScript
B. Enable Debug Mode for Lightning components for the user
C. Use Developer Console to view checkpoints
D. Use console
E. Use Developer Console to view the debug log
View answer
Correct Answer: ABD
Question #16
Which two of the examples above have correct System.debug statements? (Choose two.) Example 1: AggregateResult[] groupedResults = [SELECT CampaignId, AVG(Amount) FROM Opportunity GROUP BY CampaignId]; for (AggregateResult ar : groupedResults) { System.debug('Campaign ID' + ar.get('CampaignId')); System.debug('Average amount' + ar.get('expr0')); } Example 2: AggregateResult[] groupedResults = [SELECT CampaignId, AVG(Amount) theAverage FROM Opportunity GROUP BY CampaignId]; for (AggregateResult ar : groupedRe
A. Example 1correct
B. Example 2correct
C. Example 3
D. Example 4
View answer
Correct Answer: AB
Question #17
What are three benefits of using declarative customizations over code? (Choose three.)
A. Declarative customizations cannot generate run time errors
B. Declarative customizations will automatically update with each Salesforce release
C. Declarative customizations do not require user testing
D. Declarative customizations are not subject to governor limits
E. Declarative customizations generally require less maintenance
View answer
Correct Answer: ABDE
Question #18
Which use case can only be performed by using asynchronous Apex?
A. Scheduling a batch process to complete in the future
B. Processing high volumes of records
C. Updating a record after the completion of an insert
D. Calling a web service from an Apex triggercorrect
View answer
Correct Answer: D
Question #19
A developer wants to call an Apex Server-side Controller from a Lightning Aura Component. What are two limitations to the data being returned by the Controller? (Choose two.)
A. A custom Apex Class can be returned, but only the values of public instance properties and methods annotated with @AuraEnabled are serialized and returned
B. Lists of Custom Apex Classes cannot be returned by Apex Controllers called by Lightning Aura Components
C. Basic data types are supported, but defaults, such as maximum size for a number, are defined by the objects that they map to
D. Only Basic data types and sObjects are supported as return types for Apex Controllers called by Lightning Aura Components
View answer
Correct Answer: AC
Question #20
Global with sharing class MyRemoter { public String accountName { get; set; } public static Account account { get; set; } public AccountRemoter(} {} @RemoteAction global static Account getAccount (String acccuntName) { account = [SELECT Id, Name, NumberOfEmployees FROM Account WHERE Name = :accountName]; return account; } } Consider the Apex class above that defines a RemoteAction used on a Visualforce search page. Which code snippet will assert that the remote action returned the correct Account?
A. MyRemoter remote = new MyRemoter(); Account a = remote
B. Account a = MyRemoter
C. MyRemoter remote = new MyRemoter('TestAccount'};Account a = remote
D. Account a = controller
View answer
Correct Answer: B
Question #21
A user receives the generic "An internal server error has occurred” while interacting with a custom Lightning component. What should the developer do to ensure a more meaningful message?
A. Add an onerror event handler to the tag
B. Add an error - view component to the markup
C. Use platform events to process the error
D. Use an AuraHandledexception in a try - catch block
View answer
Correct Answer: D
Question #22
A company has code to update a Request and Request Lines and make a callout to their external ERP system’s REST endpoint with the updated records. What should be done to address the problem?
A. Move the CalloutUtil
B. Remove the Database
C. Change the CalloutUtil
D. Change the CalloutUtil
View answer
Correct Answer: D
Question #23
Which technique can run custom logic when a Lightning web component is loaded?
A. Call S
B. enqueueAction and pass in the method to call
C. Use the renderedCallback () method
D. Use an init event to call a function
E. Use the connected-allbacM) method
View answer
Correct Answer: D
Question #24
Recently a Salesforce org's integration failed because it exceeded the number of allowed API calls in a 24-hour period. The integration handles a near real-time, complex insertion of data into Salesforce. The flow of data is as follows: - The integration looks up Contact records with a given email address and, if found, the integration adds a Task to the first matching Contact it finds. - If a match is not found, the integration looks up Lead records with a given email address and, if found, the integration
A. Use the REST API as well as the SOAP API to effectively double the API calls allowed in a 24-hour period
B. Create an Inbound Message that, using Flow, can do all of the logic the integration code was doing
C. Write a custom Apex web service that, given an email address, does all of the logic the integration code was doing
D. Create several Apex InboundEmailHandlers to accept calls from the third-party system, thus bypassing the API limits
View answer
Correct Answer: D
Question #25
A company wants to incorporate a third-party web service to set the Address fields when an Account is inserted, if they have not already been set. What is the optimal way to achieve this?
A. Create a Process, call an Apex @future(callout=true) method from it, and make the callout from that Apex method
B. Create a Process, call an Apex @InvocableMethod from it, and make the callout from that Apex method
C. Create an after insert trigger, call an Apex @InvocableMethod method from it, and make the callout from that Apex method
D. Create an after insert trigger, call an @future(callout=true) method from it, and make the callout from that Apex method
View answer
Correct Answer: D
Question #26
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?
A. Ensure queries do not exceed governor limits
B. Ensure properties are marked as Transient
C. Ensure properties are marked as private
D. Ensure profiles have access to the Visualforce page
View answer
Correct Answer: B
Question #27
Which is a valid Apex REST Annotation? (Choose two.)
A. @HttpPatch
B. @HttpDelete
C. @HttpUpsert
D. @HttpAction
View answer
Correct Answer: AB
Question #28
A company's support process dictates that any time a Case is closed with a Status of 'Could not fix', an Engineering Review custom object record should be created and populated with information from the Case, the Contact, and any of the Products associated with the Case. What is the correct way to automate this using an Apex trigger?
A. An after update trigger that creates the Engineering Review record and inserts it
B. A before update trigger that creates the Engineering Review record and inserts it
C. An after upsert trigger that creates the Engineering Review record and inserts it
D. A before upsert trigger that creates the Engineering Review record and inserts it
View answer
Correct Answer: A
Question #29
A developer Is tasked with ensuring that email addresses entered into the system for Contacts and for a Custom Object called Survey_Response__c do not belong to a list of blacklisted domains. The list of blacklisted domains will be stored In a custom object for ease of maintenance by users. Note that the Survey_Response__c object is populated via a custom visualforce page. What is the optimal way to implement this?
A. Implement the logic in an Apex trigger on Contact and also implement the logic within the Custom visualforce page controller
B. Implement the logic in the Custom Visualforce page controller and call that method from an Apex trigger on Contact
C. Implement the logic in a helper class that is called by an Apex trigger on Contact and from the Custom Visualforce page controller
D. Implement the logic in a Validation Rule on the Contact and a validation Rule on the Survey_Response__c object
View answer
Correct Answer: C
Question #30
A developer has working business logic code, but sees the following error in the test class: You have uncommitted work pending. Please commit or rollback before calling out. What is a possible solution?
A. Rewrite the business logic and test classes with ?TestVisible set on the callout
B. Set seeAIIData to "true" at the top of the test class, since the code does not fail in practice
C. Call support for help with the target endpoint, as it is likely an external code error
D. Use test
View answer
Correct Answer: D

View The Updated Salesforce Exam Questions

SPOTO Provides 100% Real Salesforce Exam Questions for You to Pass Your Salesforce Exam!

View Answers after Submission

Please submit your email and WhatsApp to get the answers of questions.

Note: Please make sure your email ID and Whatsapp are valid so that you can get the correct exam results.

Email:
Whatsapp/phone number: