PDII Free Certification Exam Material from CramPDF with 198 Questions
Use Real PDII - 100% Cover Real Exam Questions
NEW QUESTION # 83
Which of the following standard fields are indexed? (Choose three.)
- A. Name
- B. CreatedBy
- C. LastModifedDdate
- D. SystemModStamp
- E. RecordType
Answer: A,B,D
NEW QUESTION # 84
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 Lightning web Components wrapped in Aura Components.
- B. Create the application using Aura Components wrapped in Lightning Web Components.
- C. Create the application using Lightning Experience Builder.
- D. Create application using Aura Components.
Answer: A,D
NEW QUESTION # 85
Universal Containers is implementing a new approval process for expense reimbursements. The process requires complex logic to determine the appropriate approver based on factors such as expense amount, employee role, and project type. The solution should allow for flexibility and future changes in the approval rules.
Which approach would be the most suitable for implementing this logic?
- A. Implement a custom formula field to calculate and determine the appropriate approver based on the given criteria.
- B. Develop a custom Lightning component to handle the approval logic and integrate it into the expense reimbursement record page.
- C. Use the Salesforce Approval Process feature and define multiple approval steps with entry criteria and approval assignments.
- D. Create a custom Apex class with a method to determine the appropriate approver based on the given criteria.
Answer: D
Explanation:
Creating a custom Apex class with methods to determine the appropriate approver is the most suitable approach when dealing with complex logic and the need for flexibility. This approach allows for centralized logic that can be easily maintained and updated as business requirements change.References: Apex Developer Guide - Apex Classes
NEW QUESTION # 86
Universal Containers wants to use a Customer Community with Customer Community Plus licenses to allow their customers access to track how many containers they have rented and when they are due back. Universal Containers uses a Private sharing model for External users, Many of their customers are multi-national corporations with complex Account hierarchies. Each account on the hierarchy represents a department within the same business, One of the requirements is to allow certain community users within the same Account hierarchy to see several departments' containers, based on a custom junction object that relates the Contact to the various Account records that represent the departments.
Which solution solves these requirements?
- A. An Apex trigger that creates Apex managed sharing records based on the junction object's relationships
- B. A Visualforce page that uses a custom controller that specifies without sharing [0 expose the records
- C. A Lightning web component on the Community Home Page that uses Lightning Data Services.
- D. A custom list view on the junction object with filters that will show the proper records based on owner
Answer: A
Explanation:
The best solution to solve these requirements is to use an Apex trigger that creates Apex managed sharing records based on the junction object's relationships. This way, the trigger can dynamically grant read-only access to the related Account records for the community users who are associated with them via the junction object. The trigger can also handle the changes in the junction object's relationships and update the sharing records accordingly. A Visualforce page that uses a custom controller that specifies without sharing will expose the records, but it will not enforce the security and visibility rules for the community users. A Lightning web component on the Community Home Page that uses Lightning Data Services will not be able to access the private Account records without proper sharing. A custom list view on the junction object with filters will not grant access to the Account records, but only show the junction object records. Reference: [Apex Managed Sharing], [Sharing a Record Using Apex], [Apex Developer Guide]
NEW QUESTION # 87
Refer to the code snippet below:
A custom object called Credit_Memo_c exist in a Salesforce environment. As part of a new feature development that retrieves and manipulates this type of record, the developer needs to ensure race conditions are prevented when a set of records are modified within an Apex transaction.
In the preceding Apex code, how can the developer alter the query statement to use SOQL features to prevent race condition within a transaction?
A)
B)
C)
D)
- A. Option A
- B. Option C
- C. Option B
- D. Option D
Answer: B
NEW QUESTION # 88
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. Create a custom event from the parent component to set the property.
- B. Move the logic from connectedCallback() nto renderedCallback().
- C. Move the logic from connectedCalIback() to constructor().
- D. Move the logic to a getter/setter pair.
Answer: D
NEW QUESTION # 89
The maximum view state size of a visualforce page is
- A. 135kb
- B. 1mb
- C. 65kb
- D. 165kb
- E. 256kb
Answer: A
NEW QUESTION # 90
Consider the following code snippet:
Choose 2 answers
- A. import ( LightningElement-apt ) from 'lwc*.-
- B. import getOrders from @salesforc/apex/c.OrderController.getAvailablOrders';
- C. import { LightningElement, wire ) from 'lwc';
- D. import getOrders from ,@salesforce/apex/OrderController.getAvailableOrders';
Answer: C,D
NEW QUESTION # 91
Refer to the markup below:
A Lightning web component displays the Account name and two custom fields out of
275 that exist on the abject. The custom fields are correctly declared and populated. However, the developer receives complaints that the component performs slowly.
What can the developer do to improve the performance?
- A. Add cache="true" to the component.
- B. Replace layout-type =''1" with fields=(fields}.
- C. Add density="compat" to the component.
- D. Replace Layout-type =''Full1" with Layout-type="Partial".
Answer: B
NEW QUESTION # 92
Just prior to a new deployment the Salesforce administrator, who configured a new order fulfillment process feature in a developer sandbox, suddenly left the company.
Ag part of the UAT cycle, the users had fully tested all of the changes in the sandbox and signed off on them; making the Order fulfillment feature ready for its go-live in the production environment.
Unfortunately, although a Change Set was started, it was not completed by the former administrator.
A developer is brought in to finish the deployment.
What should the developer do to identify the configuration changes that need to be moved into production?
- A. In Salesforce setup, look at the last modified date for every object to determine which should be added to the Change Set.
- B. Leverage the Setup Audit Trail to review the changes made by the departed Administrator and identify which changes should be added to the Change Set.
- C. Use the Metadata API and a supported development IDE to push all of the configuration from the sandbox into production to ensure no changes are lost.
- D. Set up Continuous Integration and a Git repository to automatically merge all changes from the sandbox metadata with the production metadata.
Answer: B
Explanation:
The best way to identify the configuration changes that need to be moved into production is to leverage the Setup Audit Trail to review the changes made by the departed Administrator and identify which changes should be added to the Change Set. The Setup Audit Trail is a feature that tracks the recent setup changes that you and other administrators have made to your org. The Setup Audit Trail can show up to 180 days of history and can be downloaded as a CSV file. The Setup Audit Trail can help the developer to find out what configuration changes were made by the former administrator, such as creating or modifying objects, fields, workflows, processes, flows, etc. The developer can then use this information to complete the Change Set and deploy it to production . Reference: [View Setup Audit Trail], [Change Sets]
NEW QUESTION # 93
A developer has created, Lightning web component that uses the get Record wire adapter.
Which three things should the developer do in a test validate the wire method is working as expected?
Choose 3 answer
- A. Import wire from 1w.
- B. Create a JSOM file with mock data.
- C. Import getRecord from Lightning/uiRecordAPi.
- D. Use the emit () API.
- E. Use an assert statement to validate results.
Answer: A,C,E
NEW QUESTION # 94
A developer receives complaints that the component loads slowly.
Which change can the developer implement to make the component perform faster?
- A. Change the type of contactInfo to "Map".
- B. Move the contents of <c: contactInfo Into the componant.
- C. Add a change event handler for showContactInfo.
- D. Change the default for showContactInfo to "False.
Answer: D
Explanation:
To make the component perform faster, the developer should change the default for showContactInfo to false. The showContactInfo attribute is used to control whether the contactInfo component is rendered or not. By default, it is set to true, which means that the contactInfo component is always rendered, even if the user does not need to see it. This can slow down the component loading, as the contactInfo component may have some complex logic or data fetching in its controller or helper. By changing the default for showContactInfo to false, the developer can improve the component performance, as the contactInfo component will only be rendered when the user clicks on the Show Contact Info button, which triggers the toggleContactInfo function and sets the showContactInfo attribute to true. Changing the type of contactInfo to "Map" would not make the component perform faster, as contactInfo is not a variable, but a component name. A Map is a collection type that stores key-value pairs, and it is not related to the component rendering. Moving the contents of <c:contactInfo> into the component would not make the component perform faster, as it would not change the logic or data fetching of the contactInfo component. It would only make the component code less modular and reusable. Adding a change event handler for showContactInfo would not make the component perform faster, as it would not change the rendering of the contactInfo component. It would only add an extra function that is executed whenever the showContactInfo attribute changes, which may not be necessary for the component functionality. Reference: [Create and Use Attributes], [Render Components Conditionally]
NEW QUESTION # 95
A developer must create a custom pagination solution for accessing approximately 2000 records and displaying 50 records on each page. Data from Salesforce will be accessed via an API and not via Apex.
How can the developer meet these requirements? (Choose two.)
- A. Use CURSOR 50 in SOQL queries
- B. Use OFFSET in SOQL queries
- C. Use LIMIT 50 in SOQL queries
- D. Use a StandardSetController
Answer: B,C
NEW QUESTION # 96
Which API can b|e used to execute unit tests? (Choose three.)
- A. SOAP API
- B. Test API
- C. Tooling API
- D. Metadata API
- E. Streaming AP
Answer: A,C,D
NEW QUESTION # 97
As part of a custom interface, a developer team creates various new Lightning web components. Each of the components handles error* using toast messages. When the development is complete, all the components are added to the same Lightning page.
During acceptance testing, users complain about the long chain of toast messages that display when errors occur loading the component Which two techniques should the developer Implement to improve the user experience?
Choose 2 answers
- A. Use the window. Alert () method to display the error messages.
- B. Use a Lightning web component to aggregate and display all errors.
- C. Use public properties on each component to display the error messages.
- D. Use a <template> tag to display in-place error messages.
Answer: C,D
NEW QUESTION # 98
A developer wrote a class named asccuntRisteryManager that relies on field history tracking. The class has a static method called getaccountHistory that Lakes in an Account as a parameter and returns a list of associated accountHistory object records.
The following test fails:
What should be done to make this test pass?
- A. The tact method should he delated since this code cannat be tested
- B. Use Test. isRunningTest (] in getAccountHistory() to conditionally return fake AccountHistory records.
- C. Create Accountdistory records manually in the test setup and write a query to get them.
- D. Use @isTest (SeeAllData=true] to see historical data from the org and query for Accountdistory records.
Answer: D
Explanation:
To make the test pass, @isTest(SeeAllData=true) should be used to allow the test to access historical data from the org. This is required because field history tracking data is not copied to a test context, so you need to allow the test to access live data to assert against it.References: Apex Developer Guide - IsTest Annotation
NEW QUESTION # 99
Exhibit:
The test method above tests an Apex trigger that the developer knows will make a lot of queries when a lot of Account are simultaneously updated to be customer.
The test method fails at the Line 20 because of too many SOQL queries
What is the correct way to fix this?
The test method above 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. Change the DataFactory class to create fewer Accounts so that the number of queries in the trigger is reduced.
- B. Replace most of the Apex Trigger with Process Builder processes to reduce the number of queries in the trigger.
- C. Add TeststartTest() before Line 18 of the code and add Test.stopTest() after line 18 of the code.
- D. Add TesLstartTest() before and Test.stop Test() after both Line 7 of the code and Line 20 of the code.
Answer: D
NEW QUESTION # 100
A company requires an external system to be notified whenever an account is updated.
What LimitException could the following code trigger?
- A. System.CalloutException: Callout from triggers are currently not supported
- B. System.LimitException: Too many callouts
- C. System.LimitException: Too many SOQL queries
- D. System.LimitException: Too many future calls
Answer: D
NEW QUESTION # 101
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 platform events.
- B. Implement the Batchable interface.
- C. Implement the Qususabls interface.
- D. Use the @future annotation.
Answer: B
NEW QUESTION # 102
When should a developer use the transient keyword? Choose 2 answers
- A. To prevent Apex interface definitions being included in the Apex-based partner WSDL.
- B. To declare an Apex variable as type-less when developing with dynamic Apex.
- C. To prevent Apex controller variables being sent to the Visualforce page as view state.
- D. To exclude Apex class variables from getting serialized if they are in a serializable class
Answer: C,D
NEW QUESTION # 103
As part of a custom development, a developer creates a Lightning Component to show how a particular opportunity progresses over time. The component must display the date stamp when any of the following fields change:
* Amount Probability, Stage, or Close Date
What is the most efficient way to Query such information?
- A. [Select NewValue, Oldvalue FROM Opportunity FieldHistory WHERE Opportunityld = :oppId AND Field IN
- B. ('StageName', Probability',Amount /CloseDate')];
- C. [Select Amount CloseDate. StageName, Probability FROM Opportunity_History WHERE Opportunityld - :oppId];
- D. [Select Amount, CloseDate, StageName, Probability FROM OpportunityHistory WHERE Opportunityld
= :oppId]; - E. [Select Newvalue, Oldvalue From OpportunityField_History Where Oppportunity = oppid AND Field IN
Answer: A
NEW QUESTION # 104
A developer is creating a lightning web component to display a calendar. The component will be used in multiple countries. In some locales, the first day of the week is a Monday, or a Saturday, or a Sunday.
What should the developer do to ensure the calendar displays accurately for users in every locale?
- A. Use a custom metadata type to store key/value pairs.
- B. Query the firstDayofweek field from the Locale for the current user.
- C. Use UserInfo,getLocale () in the component.
- D. Import the FirstDayofweek property m the component
Answer: C
NEW QUESTION # 105
......
Dumps Brief Outline Of The PDII Exam: https://www.crampdf.com/PDII-exam-prep-dumps.html
PDII Training & Certification Get Latest Salesforce Developers: https://drive.google.com/open?id=1PC_BvWlpC1ez3jyMpuiBX0GB3W5x2aOE