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 Certified Platform Developer II (Salesforce PDII) Sample Questions and Answers? | 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 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 #2
Universal Containers (UC) has custom Order and Order Line objects that represent orders placed by its customers. A developer has a new requirement that UC's external enterprise resource planning (ERP) system must be able to integrate with Salesforce to create orders for existing customers in Salesforce whenever an order is placed in the ERP system. What should the developer use to create the orders in Salesforce7
A. Connect API
B. Change Data Capture API
C. SObject Tree API
D. Event Monitoring API
View answer
Correct Answer: A
Question #3
A developer created a class that implement he Queueable interface, as follows:As part of the deployment process, the developer is asked to create a corresponding test class.Which two actions should the developer take to successfully execute the test class? Choose 2 answers
A. Ensure the running user of the test class has, at least, the View All permission on the Order object
B. Enclose System
C. Implement seeAllData-true to ensure the Queueable )ob is able to run in bulk mode
D. Implement Test
View answer
Correct Answer: CD
Question #4
A company has a custom object Sales_Help_Request__c that has a Lookup relationship to Opportunity. The Sales_Help_Request__c has a number field, Number_of_Hours__c, that represents the amount of time spent on the Sales_Help_Request__c. A developer is tasked with creating a field, Total_Hours__c, on Opportunity that should be the sum of all of the Number_of_Hours__c values for the Sales_Help_Request__c records related to that Opportunity. What should the developer use to implement this?
A. A workflow rule on the Sales_Help_Request__c object
B. A roll-up summary field on the Opportunity object
C. A trigger on the Opportunity object
D. A trigger on Sales_Help_Request__c
View answer
Correct Answer: D
Question #5
Which two best practices should the developer Implement to optimize this code? Choose 2 answers
A. Use a collection for the DML statement
B. Query the Pricing_structure__c records outside of the loop
C. Change the trigger context to after update, after insert
D. Remove the DML statement
View answer
Correct Answer: BD
Question #6
A developer wants to integrate invoice and invoice line data into Salesforce from a custom billing system. The developer decides to make real-time callouts from the billing system using the SOAP API. Unfortunately, the developer is getting a lot of errors when inserting the invoice line data because the invoice header record doesn't exist yet.What will help ensure the transactional integrity of the integration?
A. Create the invoice header and the related invoice lines in the same create() call leveraging External Ids
B. Develop a custom Apex web service to handle a custom JSON data structure with both invoice header and related invoice lines
C. Use an ETL tool and the Bulk API running nightly, thus ensuring all of the data is handled at the same time
D. Set the AIIOrNoneHeader to true when calling each of create() for invoice headers and create() for invoice lines
View answer
Correct Answer: A
Question #7
When developing a Lightning web component, which setting displays lightning-layout-items in one column on small devices, such as mobile phones, and in two columns on tablet-size and desktop-size screens?
A. Set size=M6" mobile-device-size="12"
B. Set size-"12" medium-device-size?quot;";
C. Set size-"12" tablet-device-size-"6"
D. Set size-"6" small-device-size-"12"
View answer
Correct Answer: B
Question #8
A lead developer for a Salesforce organization needs to develop a page-centric application that allows the user to interact with multiple objects related to a Contact The application needs to implement a third-party JavaScript framework such as Angular, and must be made available in both Classic and Lightning Experience. Given these requirements, what is the recommended solution to develop the application?
A. Aura Components
B. Lightning Web Components
C. Visualforce
D. Lightning Experience Builder
View answer
Correct Answer: C
Question #9
A developer is creating a page in App Builder that will be used in the Salesforce mobile app. Which two practices should the developer follow to ensure the page operates with optimal performance? Choose 2 answers
A. Limit five visible components on the page
B. Limit 25 fields on the record detail page
C. Limit the number of Tabs and Accordion components
D. Analyze the page with Performance Analysis for App Builder
View answer
Correct Answer: ABD
Question #10
A Visualforce Page throws an Attempt to dereference a null object error for a Contact. What change In the controller will fix the error?
A. Declare a static final Contact at the top of the controller
B. Change the setters signature to return a Contact
C. Use a condition in the getter to return a new Contact if it is null
D. Change the getter's signature to be static Contact
View answer
Correct Answer: C
Question #11
In a VisualForce page with a VisualForce component that has rendered set to false when the page loads, how can a developer ensure it will show on a re-render?
A. Set the re-render attribute of the component to true
B. Perform a full page refresh since rendered elements cannot be re-rendered without refreshing
C. Set the rendered attribute of the component to true and re-render the component
D. Set the rendered attribute of the component to true and re-render a parent component
View answer
Correct Answer: D
Question #12
The Contact object in an org is configured with workflow rules that trigger field updates. The fields are not updating, even though the end user expects them to. The developer creates a debug log to troubleshoot the problem.What should the developer specify in the debug log to see the values of the workflow rule conditions and debug the problem?
A. INFO level for the Database log category
B. ERROR level for the Workflow log category
C. ERROR level for the Database log category
D. INFO level for the Workflow log category
View answer
Correct Answer: A
Question #13
Refer to the markup below:A Lightning web component displays the Account name and two custom fields out of 275 that exist on the object. The developer receives complaints that the component performs slowly.What can the developer do to improve the performance?
A. Option A
B. Option B
C. Option C
D. Option D
View answer
Correct Answer: C
Question #14
A company wants to run different logic based on an Opportunity's record type. Which code segment handles this request and follows best practices?
A. Option A
B. Option B
View answer
Correct Answer: A
Question #15
When calling a RESTful web service, a developer receives a JSON payload that has a data hierarchy that is nested three levels deep. How can the developer describe the external data?
A. Deserialize the data untyped and then process it
B. Declare a class with three levels and deserialize the JSON typed with this class
C. Use the ANT migration tool, the custom metadata API, or the Dataloader
D. Use middleware to flatten the JSON and consume it as a new custom object
View answer
Correct Answer: A
Question #16
Which three approaches should a developer implement to obtain the best performance for data retrieval when building a Lightning web component? (Choose three.)
A. Use (Cacheable=true) whenever possible
B. Use the Lightning Data Service
C. Use layoutTypes: [`Full'] to display a set of fields
D. Use lazy load for occasionally accessed data
E. Use getRecordUi to obtain metadata
View answer
Correct Answer: ABE
Question #17
Consider the following queries. For these queries, assume that there are more than 200,000 Account records. These records include soft-deleted records; that is, deleted records that are still in the Recycle Bin. Note that there are two fields that are marked as External Id on the Account. These fields are Customer_Number__c and ERP_Key__c. Which two queries are optimized for large data volumes? Choose 2 answers
A. SELECT Id FROM Account WHERE Id IN : aListVariablecorrect
B. SELECT Id FROM Account WHERE Name != '' AND IsDeleted = false
C. SELECT Id FROM Account WHERE Name != NULL
D. SELECT Id FROM Account WHERE Name != '' AND Customer Number c = 'ValueA’correct
View answer
Correct Answer: AD
Question #18
A developer creates an application event that has triggered an infinite loop. What may have caused this problem?
A. The event has multiple handlers registered in the project
B. The event handler calls a trigger
C. An event is fired ontouchend" and is unhandled
D. The event Is fired from a custom renderer
View answer
Correct Answer: D
Question #19
Refer to the code snippet below: As part of an Integration development effort, a developer is tasked to create an Apex method mat solely relies on the use of foreign identifiers In order to relate new contact records to existing Accounts in Salesforce. The account object contains a field marked as an external ID, the API Name of this field is Legacy_Id_c. What Is the most efficient way to instantiate the parentAccount: variable on line 02 to ensure the newly created contact is properly related to the Accoun
A. Option Acorrect
B. Option B
C. Option C
D. Option D
View answer
Correct Answer: A
Question #20
A company has a Request__c object that has a lookup to the Opportunity object and a custom field. Status__c, with values of Open,' Closed, and Invalid.' An Opportunity should not be allowed to be deleted if there are any Request__c records related to it that have a Status__c value of Open or 'Closed.' what is the optimal way to enforce therequirement to prevent deletion?
A. A Process on Request__c
B. A Process on Opportunity
C. An Apex Trigger on Opportunity
D. An Apex Trigger on Request__c
View answer
Correct Answer: C
Question #21
A comply his reference data stored m multiple custom metadata records that represent del auh information and delete behavior for certain geographic regions. When a contact is inserted, the default information should be set on the contact from the custom metadata records based on the contact's address information. Additionally, if a user attempts to delete a contact that belongs to a flagged region, the user must get an error message. Depending on company personnel resources, what are two ways to automate th
A. Apex mvocaWe methodcorrect
B. Remote action
C. Flow Buildercorrect
D. Apex triggercorrect
View answer
Correct Answer: ACD
Question #22
Get Cloudy Consulting (GCC) has a multitude of servers that host its customers' websites. GCC wants to provide a servers status page that is always on display in its call center. It should update in real time with any changes made to any servers. To accommodate this on the server side, a developer created a Server Update platform event. The developer is working on a Lightning web component to display the information. What should be added to the Lightning web component to allow the developer to interact with
A. import { subscribe, unsubscribe, onError } from 'lightning/MessageChannel'
B. import { subscribe, unsubscribe, onError } from 'lightning/empApi';correct
C. import { subscribe, unsubscribe, onError } from 'lightning/pubsub'
D. import { subscribe, unsubscribe, onError } from 'lightning/ServerUpdate'
View answer
Correct Answer: B
Question #23
A developer is debugging an Apex-based order creation process that has a requirement to have three savepoints, SP1, SP2, and SP3 (created in order), before the final execution of the process. During the final execution process, the developer has a routine to roll back to SP1 for a given condition. Once the condition is fixed, the code then calls a roll back to SP3 to continue with final execution. However, when the roll, back to SP3 is called, a runtime error occurs. Why does the developer receive a runtime
A. The developer should have called SP2 before calling SP3
B. SP3 became invalid when SP1 was rolled back
C. The developer has too many DML statements between the savepoints
D. The developer used too many savepoints in one trigger session
View answer
Correct Answer: B
Question #24
Consider the following code snippet: Which two steps should the developer take to add flexibility to change the endpolnt and credentials without needing to modify code? Choose 2 answers
A. Create a Named Credential, endPoint_NC, to store the endpoint and credentials
B. Store the URL of the endpoint in a custom Label named endPointUR
C. Use req
D. Use req
View answer
Correct Answer: A
Question #25
Which scenario requires a developer to use an Apex callout instead of Outbound Messaging?
A. The callout needs to be asynchronous
B. The callout needs to be invoked from a Workflow Rule
C. The Target system uses a REST APcorrect
D. The Target system uses a SOAP AP
View answer
Correct Answer: C
Question #26
A developer is building a Lightning web component to get data from an Apex method called getData that takes a parameter, name. The data should be retrieved when the user clicks the Load Data button. Exhibit.What must be added to get the data?
A. Add @wire(getData, (name: $name')} to the account field and this, account = getData ( ) ; to t loadData ( ) function
B. Add this, account = getData (this,name); to the loadData ( ) function
C. Add getData ({ name; this,name}) , then (result=> { this
D. Add @wire(getData, {name: $name'}) to the account field and delete loadData ( ) because it is not needed
View answer
Correct Answer: C
Question #27
An Apex trigger and Apex class increment a counter, Edit_Count_c, any time that the Case is changed. A new process on the case object was just created in production for when a Case is created or updated< since the process was created, they are reports that the Count is being incremented by more than one on Case edit. Which change in the Apex code will fix the problem?
A. Option A
B. Option B
C. Option C
D. Option D
View answer
Correct Answer: A
Question #28
A developer needs to implement a system audit feature that allows users, assigned to a custom profile named "Auditors", to perform searches against the historical records in the Account object. The developer must ensure the search is able to return history records that are between 12 and 24 months old. Given the code below, which select statement should be inserted below as a valid way to retrieve the Account History records ranging from 12 to 24 month old? A) B) C) D)
A. Option A
B. Option B
C. Option C
D. Option D
View answer
Correct Answer: D
Question #29
A developer is asked to look into an issue where a scheduled Apex is running into DML limits. Upon investigation, the developer finds that the number of records processed by the scheduled Apex has recently increased to more than 10,000.What should the developer do to eliminate the limit exception error?
A. Use the @future annotation
B. Implement the Bathable interface
C. Use platform events
D. Implement the Queueable interface
View answer
Correct Answer: B
Question #30
A developer is creating a Lightning web component that contains a child component. The property stage is being passed from the parent to the child. The public property is changing, but the setOppList function is not being invoked.What should the developer change to allow this?
A. Move the logic from connectedCalIback() to constructor()
B. Create a custom event from the parent component to set the property
C. Move the logic from connectedCallback() nto renderedCallback()
D. Move the logic to a getter/setter pair
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: