Month End Sale Limited Time 70% Discount Offer - Ends in 0d 00h 00m 00s - Coupon code: simple70

Pass the Salesforce Developers PDII Questions and answers with CertsForce

Viewing page 1 out of 5 pages
Viewing questions 1-10 out of questions
Questions # 1:

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 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

Options:

A.

Use the Continuation=true attribute in the Apex method.14


B.

Edit the code to use the without sharing keyword in the Apex class.15


C.

Use the Cacheable=true attribute in the Apex method.16


D.

Ensure the OWD for the Opportunity object is Public.17


Expert Solution
Questions # 2:

Refer to the Aura component below:

HTML

<aura:component>

<aura:attribute name="contactInfo" type="Object"/>

<aura:attribute name="showContactInfo" type="boolean" default="true"/>

<aura:handler name="init" value="{!this}" action="{!c.init}"/>

<aura:if isTrue="{!v.showContactInfo}">

</aura:if>

</aura:component>

A developer receives complaints that the component loads slowly. Which change can the developer implement to make the component perform faster?

Options:

A.

Move the contents of into the component.


B.

Change the type of contactInfo to "Map".


C.

Change the default for showContactInfo to "false".


Expert Solution
Questions # 3:

A developer writes a Lightning web component that displays a dropdown list of all custom objects in the org. An Apex method prepares and returns data to the component. What should the developer do to determine which objects to include in the response?

Options:

A.

Import the list of all custom objects from @salesforce/schema.


B.

Check the getObjectType() value for 'Custom' or 'Standard' on the sObject describe result.


C.

Check the isCustom() value on the sObject describe result.


D.

Use the getCustomObjects() method from the Schema class.


Expert Solution
Questions # 4:

Java

@isTest

static void testUpdateSuccess() {

Account acet = new Account(Name = 'test');

insert acet;

// Add code here

extension.inputValue = 'test';

PageReference pageRef = extension.update();

System.assertNotEquals(null, pageRef);

}

What should be added to the setup, in the location indicated, for the unit test above to create the controller extension for the test?

Options:

A.

AccountControllerExt extension = new AccountControllerExt(acet);


B.

ApexPages.StandardController sc = new ApexPages.StandardController(acet); AccountControllerExt extension = new AccountControllerExt(sc);


C.

ApexPages.StandardController sc = new ApexPages.StandardController(acet.Id); AccountControllerExt extension = new AccountControllerExt(sc);


D.

AccountControllerExt extension = new AccountControllerExt(acet.Id);


Expert Solution
Questions # 5:

The Account after-update trigger fires whenever an Account's address is updated, and it updates every associated Contact with that address. The Contact after-update trigger fires on every edit, and it updates every Campaign Member record related to the Contact with the Contact's state. Consider the following: A mass update of 200 Account records' addresses, where each Account has 50 Contacts. Each Contact has one Campaign Member. This means there are 10,000 Contact records across th23e Accounts and 10,000 Campaign Member records across the contacts. What will happen when the mass update occurs?24252627

Options:

A.

The mass update of Account address 28will succeed, but the Contact address updates wil29l fail due to exceeding number of records processed by DML statements.3031


B.

There will be no32 error, since each trigger fires 33within its own context and each trigger does not exceed the limit of the number of records processed by DML statements.34


C.

The mass update will fail, since the two triggers fire in the same35 context, thus exceeding the number of records.36


Expert Solution
Questions # 6:

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?

Options:

A.

Implement the Batchable interface.


B.

Use platform events.


C.

Use the @future annotation.


D.

Implement the Queueable interface.


Expert Solution
Questions # 7:

A developer created the following test method:

Java

@isTest(SeeAllData= true)

public static void testDeleteTrigger(){

Account testAccount = new Account(name = 'Test1');

insert testAccount;

List testAccounts = [SELECT Id, Name from Account WHERE Name like 'Test%'];

System.assert(testAccounts.size() > 0);

delete testAccounts;

testAccounts = [SELECT Id, Name from Account WHERE Name like 'Test%'];

System.assert(testAccounts.size() == 0);

}

The developer org has five accounts where the name starts with "Test". The developer executes this test in the Developer Console.

After the test code runs, which statement is true?

Options:

A.

There will be five accounts where the name starts with "Test".


B.

There will be no accounts where the name starts with "Test".


C.

There will be six accounts where the name starts with "Test".


D.

The test will fail.


Expert Solution
Questions # 8:

A developer is tasked with ensuring that email addresses entered into the system for Contacts and for a custom object called Survey_Response__c do not belong to a list of blocked domains. The list of blocked domains is stored in a custom object for ease of maintenance by users. The Survey_Response__c object is populated via a custom Visualforce page. What is the optimal way to implement this?

Options:

A.

Implement the logic in validation rules on the Contact and the Survey_Response__c objects.


B.

Implement the logic in a helper class that is called by an Apex trigger on Contact and from the custom Visualforce page controller.


C.

Implement the logic in an Apex trigger on Contact and also implement the logic within the custom Visualforce page controller.


Expert Solution
Questions # 9:

Universal Containers has an Apex trigger on Account that creates an Account Plan record when an Account is marked as a Customer. Recently a record-triggered flow was added to update a date field. Since the addition of the flow, two Account Plan records are created. What might cause this to happen?

Options:

A.

The Apex trigger is not bulk safe and calls insert inside of a for loop.


B.

The flow is configured to use an 'Update Records' element.


C.

The flow is configured to evaluate when a record is created and every time it is edited.


D.

The Apex trigger does not use a static variable to ensure it only fires once.


Expert Solution
Questions # 10:

Refer to the component code and requirements below:

HTML

{!v.account.Name}

{!v.account.AccountNumber}

{!v.account.Industry}

Requirements:

    For mobile devices, the information should display in three rows.

    For desktops and tablets, the information should display in a single row.

Requirement 2 is not displaying as desired. Which option has the correct component code to meet the requirements for desktops an7d tablets?

Options:

A.

HTML

{!v.account.Name}

{!v.account.AccountNumber}

{!v.account.Industry}


B.

1213


C.

1415

HTML

{!v.account.Name}

{!v.account.AccountNumber}

{!v.account.Industry}


D.

HTML

{!v.account.Name}

{!v.account.AccountNumber}

{!v.account.Industry}


Expert Solution
Viewing page 1 out of 5 pages
Viewing questions 1-10 out of questions