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) Test 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 used custom settings to store some configuration data that changes occasionally. However, tests are now failing in some of the sandboxes that were recently refreshed. What should be done to eliminate this issue going forward?
A. Set the setting type on the custom setting to List
B. Replace custom settings with custom metadata
C. Set the setting type on the custom setting to Hierarchy
D. Replace custom settings with static resources
View answer
Correct Answer: B
Question #2
A developer wrote a trigger on Opportunity that will update a custom Last Sold Date field on the Opportunity's Account whenever an Opportunity is closed. In the test class for the trigger, the assertion to validate the Last Sold Date field fails. What might be causing the failed assertion?
A. The test class has not defined an Account owner when inserting the test data
B. The test class has not re-queried the Account record after updating the Opportunity
C. The test class has not implemented seeAIIData-truwh the test method
D. The test class is not using System
View answer
Correct Answer: B
Question #3
Which type of controller is best suited when you want all of the basic DML functions from an object's normal new/edit page and want to include multiple records?
A. Standard Controller
B. Standard List/Set Controller
C. Controller Extensions
D. Custom Controller
View answer
Correct Answer: B
Question #4
A developer has a Visual force page that automatically assign ownership of an Account to a queue save. The page appears to correctly assign ownership, but an assertion validating the correct ownership fails. What can cause this problem?
A. The test class does not use the Bulk API for loading test data
B. The test class does not retrieve the updated value- from the database
C. The test class does not use the seeAllData=true annotation,
D. The test class does not implement the Queueabfe interface
View answer
Correct Answer: B
Question #5
Universal Containers stores user preferences in a Hierarchy Custom Setting, User_prefs_c, with a Checkbox field, show_Help_c, Company-Level defaults are stored at the organizational level, but may be overridden at the user level, If a user has not overridden preferences, then the defaults should be used.How should the Show_Help_c preference be retrieved for the current user?
A. Boolean show = User_Prefs_c, getinstance( ), Show_Help _c;
B. Boolean show = User_Prefs_c, getValues ( )
C. Boolean show = User_Prefs_c, getvaluesUserInfo
D. Boolean show = User prefs_c, Show_Help_c;
View answer
Correct Answer: A
Question #6
A company recently deployed a Visualforce page with a custom controller that has a data grid of information about Opportunities in the org. Users report that they receive a "Maximum view state size limit" error message under certain conditions. According to Visualforce best practice, which three actions should the developer take to reduce the view state? (Choose three.)
A. Use the transient keyword in the Apex controller for variables that do not maintain state
B. Use the final keyword in the controller for variables that will not change
C. Use the private keyword in the controller for variables
D. Refine any SOQL queries to return only data relevant to the page
E. Use filters and pagination to reduce the amount of data
View answer
Correct Answer: ACE
Question #7
Consider the code above.When a user clicks on the Link of a Contact's name, what happens?
A. The outputPanel refreshes, showing the Contacts details
B. A new page opens, showing the Contact's details
C. The page refreshes, showing the Contact's details
D. Nothing happens: the commandLink is missing an action attribute
View answer
Correct Answer: A
Question #8
Which method should be used to convert a Date to a String in the current user's locale?
A. Date
B. Date
C. String
D. String
View answer
Correct Answer: A
Question #9
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 two steps should the developer take to achieve this?Choose 2 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: CD
Question #10
There is an Apex controller and a Visualforce page in an org that displays records with a custom filter consisting of a combination of picklist values selected by the user.The page takes too long to display results for some of the input combinations, while for other input choices it throws the exception, *Maximum view state size limit exceeded.What step should the developer take to resolve this issue?
A. Split the layout to filter records in one Visualforce page and display the list of records in a second page using the same Apex Controller
B. Adjust any code that filters by picklist values since they are not indexed
C. Use a StandardSetController or SOQL LIMIT in the Apex controller to limit the number of records displayed at a time
D. Remove instances of the transient keyword from the Apex controller to avoid the view state error
View answer
Correct Answer: C
Question #11
Universal Containers (UC) has enabled the translation workbench and has translated picklist values. UC has a custom multi-select picklist field, Products__z, on the Account object that allows sales reps to specify which of UC's products an Account already has. A developer is tasked with writing an Apex method that retrieves Account records, Including product_c field. What should the developer do to ensure the value of Products__c is in the current user's language?
A. Set the locale on each record in the SOQL result list
B. Use the locale clause in the SOQL query
C. Use toLabel1 Products_c in the fields list of the SOQL query
D. Call the translate ( ) method on each record in the SOQL result list
View answer
Correct Answer: C
Question #12
Universal Containers uses a custom Lightning page to provide a mechanism to perform a step-by-step wizard search for Accounts. One of the steps in the wizard is to allow the user to input text into a text field, ERP_Number__c, that is then used in a query to find matching Accounts. A developer receives the exception 'SOQL query not selective enough. Which step should be taken to resolve the issue?
A. Move the SOQL query to within an asyncronous process
B. Mark the lRP_Number__c field as an external ID
C. Perform the SOQL query as part of a for loop
D. Mark the ERP_Number__c field as required
View answer
Correct Answer: D
Question #13
A company accepts orders for customers in their enterprise resource planning (ERP) crder__c records with a lookup field to Account. The Account object has an External ID field, ERP_Customer_ID__c. What should the integration use to create new Order__c records that will automatically be related to the correct Account?
A. Upsert on the Account and specify the ERP_Customer_ID__c
B. Merge on the Order__c object and specify the ERP_Customer_ID__c
C. Insert on the Order__c object followed by an update on the Order__c object
D. Upsert on the Order__c object and specify the ERP_Customer_ID__c
View answer
Correct Answer: C
Question #14
An end user reports that a Lightning component is performing poorly.Which two steps should to taken in production to investigate? Choose 2 answers
A. Enable Debug Mode for Lightning component
B. Print consoIe
C. Use the salesforce Lightning inspector chrome extension
D. Add a trace flag to the user who reported the issue
View answer
Correct Answer: CD
Question #15
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 Account?
A. Option A
B. Option B
C. Option C
D. Option D
View answer
Correct Answer: A
Question #16
Consider the controller code above that is called from a Lightning component and returns data wrapped in a class. Consider the controller code above that is called from a Lightning component and returns data wrapped in a class.The developer verified that the Queries return a single record each and there is error handing in the Lightning component, but the component is not getting anything back when calling the controller getSomeData().What is wrong?
A. The member's Name and Option of the class MyDataWrapper should be annotated with @AuraEnabled too
B. The member's Name and Option should not be declared public
C. The member's Name and Option should not have getter and setter
D. Instances of Apex classes such as MyDataWrapper cannot be returned to a Lightning component
View answer
Correct Answer: A
Question #17
An org has a requirement that addresses on Contacts and Accounts should be normalized to a company standard by Apex code any time that they are saved.What is the optimal way to implement this?
A. Apex trigger on Account that calls the Contact trigger to normalize the address
B. Apex trigger on Contact that calls the Account trigger to normalize the address
C. Apex trigger on Account that and Account that normalized the address
D. Apex trigger on Account and Account that call a helper class to normalize the address
View answer
Correct Answer: B
Question #18
Universal Containers has a Visualforce page that displays a table every Container_ c being rented by a gives Account.. failing because some of the customers rent over 100,000 containers. What should a developer change about the Visualforce page to help with the page load errors?
A. Implement pagination with an OffsetController
B. Implement pagination with a StandardSetController
C. Use lazy loading and a transient List variable
D. Use JavaScript remoting with SOQL Offset
View answer
Correct Answer: B
Question #19
A developer wants to use an Aura Component with a Custom Action. What should be considered in order to do this?
A. A default value must be provided for each component attribute marked as required
B. The component must implement the force:lightningQuickActionButton interface
C. The component's JavaScript controller must handle a method on initialization
D. The class "slds-modal__container" must be added to the top-level element of the component
View answer
Correct Answer: B
Question #20
A developer needs to store variables to control the style and behavior of a Lightning Web Component. Which feature should be used to ensure that the variables are testable in both Production and all Sandboxes?
A. Custom Metadatacorrect
B. Custom Object
C. Custom Setting
D. Custom Variable
View answer
Correct Answer: A
Question #21
An Apex trigger creates a Contract record every time an Opportunity record is marked as Closed end Won. This trigger is working great, except (due to a recent acquisition) historical Opportunity records need to be loaded into the Salesforce instance.When a test batch of records are loaded, the Apex trigger creates Contract records. A developer is tasked with preventing Contract records from being created when mass loading the Opportunities, but the daily users still need to have theContract records created.
A. Use a List Custom Setting to disable the trigger for the user who loads the data
B. Add a Validation Rule to the Contract to prevent Contract creation by the user who loads the data
C. Use a Hierarchy Custom Setting to skip executing the logic inside the trigger for the user who loads the data
D. Add the Profile ID of the user who loads the data to the trigger so the trigger will not fire for this user
View answer
Correct Answer: C
Question #22
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 #23
Refer to the code segment above.When following best prachces for writing Apex triggers, which two lines are wrong or cause for concern? Choose 2 answers
A. Lines
B. Line 12
C. Line 16
D. Line 20
View answer
Correct Answer: AD
Question #24
Which three Visualforce components can be used to initiate Ajax behavior to perform partial page updates? Choose 3 answers
A.
B.
C.
D.
E.
View answer
Correct Answer: ABD
Question #25
What is a benefit of using a WSDL with Apex?
A. Allows for web services to be tested and achieve code coverage
B. Allows for classes to be imported into Salesforce
C. Reduces the number of callouts to third-party web services
D. Enables the user to not pass a Session ID where it is not necessary
View answer
Correct Answer: B
Question #26
A developer is asked to build a solution that will automatically send an email to the Customer when an Opportunity stage changes. The solution must scale to allow for 10,000 emails per day. The criteria to send the email should be evaluated after all Workflow Rules have fired. What is the optimal way to accomplish this?
A. Use a Workflow Email Alert
B. Usea MassEmailMessage() with an Apex Trigger
C. Use a SingleEmailMessage() with an Apex Trigger
D. Use an Email Alert with Process Builder
View answer
Correct Answer: D
Question #27
Consider the following code snippet:A developer needs to built an interactive Aura component that responds to the user's input by hiding or showing sections according the user preferences.What are two best practices the developer can implement to hide or show the powerVserView and s-rar.daraVserView inner components, based on the value of the attribute isPowexUser?Choose 2 answers
A. Option A
B. Option B
C. Option C
D. Option D
View answer
Correct Answer: B
Question #28
A developer 15 tasked with creating an application-centric feature on which end-users can access and update information. This feature must be available in lightning Experience while working seamlessly in multiple device form factors, such as desktops, phones, and tablets. Additionally, the feature must support Addressable URL Tabs and interact with the Salesforce Console APIs.What arm two approaches a developer can take to build the application and support the business requirements ^Choose 2 answers
A. Create the application using Aura Components wrapped in Lightning Web Components
B. Create the application using Lightning web Components wrapped in Aura Components
C. Create application using Aura Components
D. Create the application using Lightning Experience Builder
View answer
Correct Answer: BC
Question #29
A developer created an Apex class that makes outbound RESTful callout. The following was created to send a fake response in Apex test methods.Which method can be called to return this fake response in the test methods?
A. TestsetMock
B. TestcreateStub
C. testSetup
D. Test
View answer
Correct Answer: A
Question #30
A developer is building a Lightning web component that displays quantity, unit price, and the total for an order line item. The total is calculated dynamically as the quantity multiplied by the unit price.What must be added to display the total?
A. Add get total() { return quantity * unitPrice;} to the JavaScript and Total: {total} in the template
B. Add calculate Total() {return quantity * unitPrice;} to the javaScript and Total : {calculate Total()} in the template
C. Add Total: {quantity * UnitPrice} in the template
D. Add Total; {multiple quantit,y unitprice)} in the template
View answer
Correct Answer: B

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: