Salesforce Platform Developer II - PDII FREE EXAM DUMPS QUESTIONS & ANSWERS

A developer creates a lightning web component to allow a Contact to be quickly entered. However, error messages are not displayed.
HTML
<template>
<lightning-record-edit-form object-api-name="Contact">
<lightning-input-field field-name="FirstName"></lightning-input-field>
<lightning-input-field field-name="LastName"></lightning-input-field>
<lightning-input-field field-name="Email"></lightning-input-field>
<lightning-button type="submit" name="submit" label="Create Contact">
</lightning-button>
</lightning-record-edit-form>
</template>
Which component should the developer add to the form to display error messages?12
Correct Answer: B Vote an answer
Explanation: Only visible for FreeCram members. You can sign-up / login (it's free).
MyOpportunities.js
JavaScript
import { LightningElement, api, wire } from 'lwc';
import getOpportunities from '@salesforce/apex/OpportunityController.findMyOpportunities'; export default class MyOpportunities extends LightningElement {
@api userId;
@wire(getOpportunities, {oppOwner: '$userId'})
opportunities;
}
OpportunityController.cls
Java
public with sharing class OpportunityController {
@AuraEnabled
public static List<Opportunity> findMyOpportunities(Id oppOwner) {
return [
SELECT Id, Name, StageName, Amount
FROM Opportunity
WHERE OwnerId = :oppOwner
];
}
}
A developer is experiencing issues with a Lightning web component. The co12mponent must surface information about Opportunities owned by the currently logged-in user. When the component is rendered, the following message is displayed: "Error retrieving data". Which action must be completed in the Apex method to make it wireable?13
Correct Answer: B Vote an answer
Explanation: Only visible for FreeCram members. You can sign-up / login (it's free).
As part of a custom interface, a developer team creates various new Lightning web components. Each of the components handles errors using toast messages. During acceptance testing, users complain about the long chain of toast messages that display when errors occur loading the components. Which two techniques should the developer implement to improve the user experience?
Correct Answer: A,C Vote an answer
Explanation: Only visible for FreeCram members. You can sign-up / login (it's free).
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?
Correct Answer: A Vote an answer
Explanation: Only visible for FreeCram members. You can sign-up / login (it's free).
How should a developer assert that a trigger with an asynchronous process has successfully run?
Correct Answer: C Vote an answer
Explanation: Only visible for FreeCram members. You can sign-up / login (it's free).
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?
Correct Answer: D Vote an answer
Explanation: Only visible for FreeCram members. You can sign-up / login (it's free).
A company uses Salesforce to sell products to customers. They also have an external product information management (PIM) system that is the system of record for products. Whenever a product is created or updated in the PIM, a product must be created or updated as a Product2 record in Salesforce and a PricebookEntry record must be created or updated automatically. The PricebookEntry should be created in a Pricebook2 that is specified in a custom setting. What should the developer use to satisfy these requirements?
Correct Answer: D Vote an answer
Explanation: Only visible for FreeCram members. You can sign-up / login (it's free).
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 certain conditions are met. What is the optimal way to accomplish this?
Correct Answer: A Vote an answer
Explanation: Only visible for FreeCram members. You can sign-up / login (it's free).
Consider the following code snippet:
Java
01 public with sharing class AccountsController{
03 @AuraEnabled
04 public List<Account> getAllAccounts(){
05 return [Select Id, Name, Industry FROM Account];
06 }
08 }
As part of the deployment cycle, a developer creates the following test class:
Java
@isTest
private class AccountsController_Test{
@TestSetup
private static void makeData(){
User user1 = [Select Id FROM User WHERE Profile.Name = 'System Administrator' ... LIMIT 1]; User user2 = [Select Id FROM User WHERE Profile.Name = 'Standard User' ... LIMIT 1]; TestUtils.insertAccounts(10,user1.Id); TestUtils.insertAccounts(20,user2.Id);
}
@isTest
private static void testGetAllAccounts(){
// Query the Standard User into memory
List<Account> result = AccountsController.getAllAccounts();
System.assertEquals(20,result.size());
}
}
When the test class runs, the assertion fails. Which change should the developer implement in the Apex test method to ensure the test method executes successfully?
Correct Answer: A Vote an answer
Explanation: Only visible for FreeCram members. You can sign-up / login (it's free).
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?
Correct Answer: A,B,E Vote an answer
Explanation: Only visible for FreeCram members. You can sign-up / login (it's free).
A Salesforce Platform Developer is leading a team that is tasked with deploying a new application to production. The team has used source-driven development, and they want to ensure that the application is deployed successfully. What tool or mechanism should be used to verify that the deployment is successful?
Correct Answer: D Vote an answer
Explanation: Only visible for FreeCram members. You can sign-up / login (it's free).
Refer to the markup below:
HTML
<template>
<lightning-record-form
record-id={recordId}
object-api-name="Account"
layout-type="Full">
</lightning-record-form>
</template>
A Lightning web component displays the Account name and two custom fields out of 275 that exist on the object. The custom fields are correctly declared and populated. However, the developer receives complain2223ts that the component performs slowly. What can the developer d2425o to improve the performance?
Correct Answer: C Vote an answer
Explanation: Only visible for FreeCram members. You can sign-up / login (it's free).
A developer created and tested a Visualforce page in their developer sandbox, but now receives reports that users encounter "View State" errors when using it in production. What should the developer ensure to correct these errors?
Correct Answer: B Vote an answer
Explanation: Only visible for FreeCram members. You can sign-up / login (it's free).
A company has reference data stored in multiple custom metadata records that represent default information and delete behavior for certain geographic regions. When a contact is inserted, the default information should be set on the contact. 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 this?16
Correct Answer: B,D Vote an answer
Explanation: Only visible for FreeCram members. You can sign-up / login (it's free).
Universal Containers analyzes a Lightning web component and its Apex controller. Based on the code snippets, what change should be made to display the contacts' mailing addresses in the Lightning web component?
Apex controller class:
Java
public with sharing class AccountContactsController {
@AuraEnabled
public static List<Contact> getAccountContacts(String accountId) {
return [SELECT Id, Name, Email, Phone FROM Contact WHERE AccountId = :accountId];
}
}
Correct Answer: C Vote an answer
Explanation: Only visible for FreeCram members. You can sign-up / login (it's free).
0
0
0
10