[Q62-Q80] Latest PDII Practice Test Questions Verified Answers As Experienced in the Actual Test!

Share

Latest PDII Practice Test Questions Verified Answers As Experienced in the Actual Test!

Pass Salesforce PDII Exam in First Attempt Easily


Salesforce PDII (Salesforce Certified Platform Developer II) Exam is a certification that is designed for developers who want to showcase their expertise in Salesforce development. Salesforce Certified Platform Developer II (PDII) certification exam is a step above the Salesforce Certified Platform Developer I certification and is intended for developers who have advanced knowledge of Salesforce development. PDII certification validates a developer's ability to design and implement advanced business logic and interfaces using Apex code, Visualforce, and Lightning components.

 

NEW QUESTION # 62
A developer created 2 class that implements the 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. Implement seeAllData=True to ensure the Queueable job is able to run in bulk mode.
  • B. Enclose System.enqueueJob(new OrderQueueableJob ()] within Tess. and Test .stopTest (1.
  • C. Implement Test. isRunningTest() to prevent chaining jobs during test execution.
  • D. Ensure the running user of the test class has, at I the View All permission on the Order object.

Answer: B,D


NEW QUESTION # 63
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. An event is fired 'ontouchend'' and is unhandled.
  • C. The event is fired from a custom renderer.
  • D. The event handler calls a trigger.

Answer: C


NEW QUESTION # 64
An Aura component has a section that displays some information about an Account and it works well on the desktop, but users have to scroll horizontally to see the description field output on their mobile devices and tablets.

How should a developer change the component to be responsive for mobile and tablet devices?

  • A.
  • B.
  • C.
  • D.

Answer: C


NEW QUESTION # 65
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?

  • A. Create a scheduled batch job that updates all contact address fields based on the related account record
  • B. Create an After Trigger on Account to update its related contact records on update
  • C. Create a Workflow Rule on Account to update related child Contact records
  • D. Create a Lightning Process on Account to update related child Contact records

Answer: D


NEW QUESTION # 66
trigger AssignOwnerByRegion on Account ( before insert, before update )
{
List<Account> accountList = new List<Account>();
for( Account anAccount : trigger.new )
{
Region__c theRegion = [
SELECT Id, Name, Region Manager__c
FROM Region__c
WHERE Name = :anAccount.Region_Name__c
];
anAccount.OwnerId = theRegion.Region_Manager__c;
accountList.add( anAccount );
}
update accountList;
}
Consider the above trigger intended to assign the Account to the manager of the Account's region.
Which two changes should a developer make in this trigger to adhere to best practices? (Choose two.)

  • A. Use a Map to cache the results of the Region__c query by Id.
  • B. Remove the last line updating accountList as it is not needed.
  • C. Use a Map accountMap instead of List accountList.
  • D. Move the Region__c query to outside the loop.

Answer: A,C


NEW QUESTION # 67
Refer to the test method below:

The test method tests an Apex trigger that the developer knows will make a lot of queries when a lot of Accounts are simultaneously updated to be customers.
The test method fails at the Line 20 because of too many SOQL queries.
What is the correct way to fix this?

  • A.
  • B.
  • C.
  • D.

Answer: C

Explanation:
The correct way to fix this is to add Test.startTest() before and add Test.stopTest() after Line 18 of the code.
This will reset the governor limits for the code that executes between these two methods, and allow the test to run without hitting the SOQL query limit. The Test.startTest() and Test.stopTest() methods are used to test code that makes a lot of queries or calls asynchronous methods12. By using these methods, the developer can isolate the code that needs more resources and verify that it does not exceed the governor limits.
References:
Using Limits, startTest, and stopTest | Apex Developer Guide | Salesforce Developers Test.StartTest & Test.StopTest - Salesforce Developer Community Why would a developer use test startTest and test stopTest in Salesforce? | ForceTalks


NEW QUESTION # 68
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. Use JavaScript remoting to query the accounts.
  • B. Use the transient keyword in the Apex code when querying the Account records.
  • C. Use the standard Account List controller and implement pagination.
  • D. Upload a third-party data table library as a static resource.

Answer: C

Explanation:
Using the standard Account List controller and implementing pagination is the best way to help alleviate the slow render times of the custom data table. This way, the Visualforce page will only load a subset of the Account records at a time, reducing the amount of data transferred and rendered. Using JavaScript remoting to query the accounts might improve the performance, but it will still load all the accounts at once, which is not efficient. Using the transient keyword in the Apex code when querying the Account records will prevent the records from being saved in the view state, but it will not reduce the query time or the render time. Uploading a third-party data table library as a static resource might enhance the look and feel of the data table, but it will not solve the underlying issue of loading too much data at once. Reference: [Standard List Controllers], [Using JavaScript Remoting to Create Visualforce Pages with Complex, Asynchronous Behavior], [Transient Keyword], [Static Resources]


NEW QUESTION # 69
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 this, account = getData (this,name); to the loadData ( ) function.
  • B. Add @wire(getData, {name: $name'}) to the account field and delete loadData ( ) because it is not needed.
  • C. Add @wire(getData, (name: $name')} to the account field and this, account = getData ( ) ; to t loadData ( ) function.
  • D. Add getData ({ name; this,name}) , then (result=> { this.account = result}) to the LeadData ( ) function.

Answer: D


NEW QUESTION # 70
A developer has a Batch Apex process, Batch_Account_Sales, that updates the sales amount for 10,000 Accounts on a nightly basis. The Batch Apex works as designed In the sandbox. However, the developer cannot get code coverage on the Batch Apex class.
The test class is below:

What is causing the code coverage problem?

  • A. The batch process will not recognize new accounts created in the same session
  • B. The executeBatch must fail within test. startTest ( ) and - test. stopTest().
  • C. The batch needs more than one account record created.
  • D. The account creation already sets the sates amount to 0.

Answer: B


NEW QUESTION # 71
What should a developer use to query all Account fields for the Acme account in their sandbox?

  • A. SELECT FIELDS FAOM Account WHERE Name = 'Acme' LIMIT 1
  • B. SELECT ALL FROM Account WHERE Name = "Acme' LIMIT 1
  • C. SELECT FIELDS (ALL) FROM Account WHERE Name = 'Acme' LIMIT 1
  • D. SELECT * FROM Recount WHERE Names = 'Aeme' LIMIT 1

Answer: C


NEW QUESTION # 72
Choose the correct definition for <apex:message>

  • A. Standard Salesforce formatting, throws a specific message on a page
  • B. No formatting; displays all errors on a page
  • C. Standard Salesforce formatting, shows all errors that occur on page. Can add more messages through the
    "ApexPages.addMessage" function
  • D. A single message, without formatting, that can be associated with a specific component on the page

Answer: B


NEW QUESTION # 73
How can a developer efficiently incorporate multiple JavaScript libraries, such as JQuery and MomentJS, in a Lightning component?

  • A. Join multiple assets from a static resource
  • B. Use JavaScript remoting and script tags
  • C. Use CDNs with script attributes
  • D. Implement the libraries in separate helper files

Answer: A


NEW QUESTION # 74
An Apex trigger creates an Order__c record every time an Opportunity is won by a Sales Rep. Recently the trigger is creating two orders.
What the optimal method for a developer to troubleshoot this?

  • A. Add system.debug() statements to the code and use the Developer Console logs to trace the code.
  • B. Set up debug logging for every Sales Rep, then monitor the logs for errors and exceptions.
  • C. Run the Apex Test Classes for the Apex trigger to ensure the code still has sufficient code coverage.
  • D. Turn off all Workflow Rules, then turn them on one at time to see which one causes the error.

Answer: A


NEW QUESTION # 75
Universal Containers wants to notify an external system in the event that an unhandled exception occurs when their nightly Apex batch job runs.
What is the appropriate publish/subscribe logic to meet this requirement?

  • A. Have the external system subscribe to a standard
    Platform Event that gets fired with with Eventbus.publish(1.
  • B. Have the external system subscribe to a standard Platform Event that gets fired.
  • C. Have the external system subscribe to a custom
    Platform Event that gets fired with EventBus.publish(1,
  • D. Have the external system subscribe to a custom Platform Event that gets fired with addError{).

Answer: C

Explanation:
To notify an external system about an unhandled exception in a batch job, the appropriate approach is to have the external system subscribe to a custom Platform Event that gets published using EventBus.publish(). When an exception occurs, the batch job can publish this event which the external system can listen for and respond to accordingly. References:
Platform Events Developer Guide


NEW QUESTION # 76
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. Call the Apex class method from a testMethod instead of the testSetup method.
  • B. Use system.assert() in testSetup to verify the values are being returned.
  • C. Verify the user has permissions passing a user into System.runAs().
  • D. Add @testVisible to the method in the class the developer is testing.

Answer: A


NEW QUESTION # 77
A developer is writing unit tests for the following method:

Which assertion would be used in a negative test case?

  • A. System.assertEquals (true, isFreezing('O')
  • B. System.assertEquals(true, isFreezing(null))
  • C. System.assertEquals(null, isFreezing('asdf))
  • D. System.assertEquals(true, isFreezingClOO'))

Answer: C


NEW QUESTION # 78
What is a potential design issue with the following code?
trigger accountTrigger on Account (before update){ Boolean processOpportunity
= false; List<opportunity> opptysClosedLost = new List<opportunity>()
List<opportunity> IstAllOpp = [select StageName from Opportunity where
accountId IN :Trigger.newMap.keySet()]; if(!IstAllOpp.isEmpty())
processOpportunity = true; while(processOpportunity){ for(opportunity o :
IstAllOpp) if(o.StageName == 'Closed - Lost') opptysClosedLost.add(o);
processOpportunity = false; if(!opptysClosedLost.isEmpty()) delete
opptysClosedLost;

  • A. The code will result in a System.DmlException:Entity_is_Deleted error
  • B. SOQL could be avoided by creating a formula field for StageName in Account from the related Opportunity
  • C. The code will result in a System.LimitException: Apex CPU time limit exceeded error
  • D. The code will result in a System.LimitException : Too many script statements error

Answer: C


NEW QUESTION # 79
What is the transaction limit for the number of DML statements allowed?

  • A. 100 (synchronous), 200 (async)
  • B. 2,000
  • C. 0
  • D. 1
  • E. 200 (synchronous), 100 (async)

Answer: D

Explanation:
Explanation
Explanation/Reference:
Explanation:
Includes Approval functions, rollbacks/savepoints, and System.runAs


NEW QUESTION # 80
......


Salesforce PDII (Salesforce Certified Platform Developer II) certification is designed for the developers who have experience in building custom applications and analytics using the Salesforce platform. It is the next level certification for the Salesforce Certified Platform Developer I (PD1) certification. The PDII certification exam validates the developer's knowledge and expertise in designing and developing advanced custom applications using Apex and Visualforce.

 

We offers you the latest free online PDII dumps to practice: https://www.test4sure.com/PDII-pass4sure-vce.html

The Most Efficient PDII Pdf Dumps For Assured Success : https://drive.google.com/open?id=1ifNUZkzyCrXufGqK3A3FeD9uJh-CD4Fy