PD1 Flashcards

1
Q

what are the methods used to show input in classic and lightning ?

A

Use visualforce page in classic and lightning component in lightning

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

A recursive transaction is limited by a DML statement creating records for these two objects:
1. Accounts
2. Contacts
The Account trigger hits a stack depth of 16.
Which statement is true regarding the outcome of the transaction?
A. The transaction fails only if the Contact trigger stack depth is greater or equalto 16.

B. The transaction succeeds as long as the Contact trigger stack depth is less than 16.

C. The transaction succeeds and all the changes are committed to the database.

D. The transaction fails and all the changes are rolled back.

A

C. The transaction succeeds and all the changes are committed to the database.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q
A developer needs to prevent the creation of request records when certain conditions exist in the system. A RequestLogic class exists to checks the conditions. What is the correct implementation?
A. Trigger RequestTrigger on Request (before insert) {
RequestLogic.validateRecords {trigger.new};
}

B. Trigger RequestTrigger on Request (before insert) {
if (RequestLogic.isvalid{Request})
Request.addError {‘Your request cannot be created at this time.’};
}

C. Trigger RequestTrigger on Request (after insert) {
if (RequestLogic.isValid{Request})
Request.addError {‘Yourrequest cannot be created at this time.’};
}

D. Trigger RequestTrigger on Request (after insert) {
RequestLogic.validateRecords {trigger.new};
}

A

A. Trigger RequestTrigger on Request (before insert) {
RequestLogic.validateRecords {trigger.new};
}

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Which standard field is required when creating a newcontact record?
A. Name

B. AccountId

C. FirstName

D. LastName

A

D. LastName

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Which two events need to happen when deploying to a production org? Choose 2 answers
A. All triggers must have at least 1% test coverage.

B. All test and triggers must have at least 75% test coverage combined

C. All triggers must have at least 75% test coverage.

D. All Apex code must have at least 75% test coverage.

A

A. All triggers must have at least 1% test coverage.

D. All Apex code must have at least 75% test coverage.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

When importing and exporting data into Salesforce, whichtwo statements are true?
Choose 2 answers
A. Bulk API can be used to bypass the storage limits when importing large data volumes indevelopment environments.

B. Bulk API can be used to import large data volumes in development environments without bypassing the storage limits.

C. Data import wizard is a client application provided by Salesforce.

D. Developer and Developer Pro sandboxes have different storage limits.

A

C. Data import wizard is a client application provided by Salesforce.

D. Developer and Developer Pro sandboxes have different storage limits.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What are three characteristics of change set deployments? (Choose three.)

A. They require a deployment connection.
B. They can be used to transfer records.
C. They can be used only between related organizations.
D. They can be used to deploy custom settings data.
E. They use an all or none deployment model.

A

A. They require a deployment connection.
C. They can be used only between related organizations.
E. They use an all or none deployment model.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

An org has an existing Visual Flow that creates an Opportunity with an Update Records element. A developer must update the Visual Flow to also create a
Contact and store the created Contact’s ID on the Opportunity.
Which update should the developer make in the Visual Flow?

A. Add a new Create Records element.
B. Add a new Quick Action (of type Create) element.
C. Add a new Update Records element.
D. Add a new Get Records element.

A

A. Add a new Create Records element.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What is an example of a polymorphic lookup field in Salesforce?

A. The WhatId field on the standard Event object
B. The ParentId field on the standard Account object
C. A custom field, Link__c, on the standard Contact object that looks up to an Account or a Campaign
D. The LeadId and ContactId fields on the standard Campaign Member object
Hide Solution

A

D. The LeadId and ContactId fields on the standard Campaign Member object
Hide Solution

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

A developer needs to create a custom Interface in Apex.
Which three considerations must the developer keep in mind while developing the Apex Interface’ Choose 3 answers
A. New methods can be added to a public interface within a released package.

B. A method defined In an Apex Interface cannot have an access modifier.

C. A method implementation can be defined within the Apex Interface.

D. The Apex interface class access modifier can be set to Private, Public, or Global.

E. The Apex class must be declared using the interface keyword.

A
B. A method defined In an Apex Interface cannot have an access modifier.
C. A method implementation can be defined within the Apex Interface.
E. The Apex class must be declared using the interface keyword.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

Which three resources in an Azure Component can contain JavaScript functions?
A. Renderer

B. Controllers

C. Design

D. helper

E. Style

A

A. Renderer
B. Controllers
D. helper

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

A Lightning component has a wired property, searchResults, that stores a list of Opportunities. Which definition of the Apex method, to which the searchResults property is wired, should be used?
A. @AuraEnabled(cacheable=false)
public static List search(String term) { /implementation/ }

B. @AuraEnabled(cacheable=false)
public List search(String term) {/implementation/ }

C. @AuraEnabled(cacheable=true)
publicList search(String term) { /*implementation*/ }

D. @AuraEnabled(cacheable=true)
public static List search(String term) { /* implementation*/ }

A

D. @AuraEnabled(cacheable=true)

public static List search(String term) { /* implementation*/ }

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

While writing a test class that coversan OpportunityLineItem trigger, a Developer is unable to create a standard PriceBook since one already exists in the org.
How should the Developer overcome this problem?
A. Use Test.getStandardPricebookId() to get the standard PriceBook ID.

B. Use Test.loadData() and a Static Resource to load a standard Pricebook.

C. Use @TestVisible to allow the test method to see the standard PriceBook.

D. Use @IsTest(SeeAllData=true) and delete the existing standard PriceBook.

A

A. Use Test.getStandardPricebookId() to get the standard PriceBook ID.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q
Universal Containers (UC) uses a custom object called Vendor. The Vendor custom object has a Master-Detail relationship with the standard Account object. Based on some internal discussion, the UC administrator tried to change the Master-Detail relationshipto a Lookup relationship but was not able to do so. What is a possible reason that this change was not permitted?
A. The Account object is included on a workflow on the Vendor object.

B. The Vendor records have existing values in the Account object.

C. The Account records contain Vendor roll-up summary fields.

D. The Vendor object must use a Master-Detail field for reporting.

A

C. The Account records contain Vendor roll-up summary fields.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

A Salesforce developer wants to review their code changesimmediately and does not want to install anything on their computer or on the org.
Which tool is best suited?
A. Setup Menu

B. Developer Console

C. Salesforce Extension for VSCode

D. Third-party apps from App Exchange

A

B. Developer Console

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

Where are two locations a developer can look to find information about the status of asynchronous or future cals? Choose 2 answers
A. Paused Flow Interviews component

B. Apex Jobs

C. Apex Flex Queue

D. Time-Based Workflow Monitor

A

B. Apex Jobs

C. Apex Flex Queue

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
17
Q

A developer has a single custom controller class that works with a Visualforce Wizard to support creating and editing multiple subjects. The wizardaccepts data from user inputs across multiple Visualforce pages and from a parameter on the initial URL.
Which three statements are useful inside the unit test to effectively test the custom controller?
Choose 3 answers
A. insert pageRef.

B. Test.setCurrentPage(pageRef);

C. public ExtendedController(ApexPages StandardController cntrl) { }

D. String nextPage - controller.save().getUrl();

E. ApexPages.CurrentPage().getParameters().put(‘input', ‘TestValue’);

A

B. Test.setCurrentPage(pageRef);
D. String nextPage - controller.save().getUrl();
E. ApexPages.CurrentPage().getParameters().put(‘input', ‘TestValue’);

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
18
Q

What are two ways for a developer to execute tests in an org?
A. Matadata API

B. Bulk API

C. Developer console

D. Tooling API

A

C. Developer console

D. Tooling API

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
19
Q

Universal Containers has an order system that uses an Order Number to identify an order for customers and service agents. Order will be imported into Salesforce.
A. Indirect Lookup

B. Lookup

C. Direct Lookup

D. Number with External ID

A

D. Number with External ID

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
20
Q

What should be used to create scratch orgs?
A. Developer Console

B. Salesforce CLI

C. Sandbox refresh

D. Workbench

A

B. Salesforce CLI

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
21
Q

Which two are phases in the Salesforce Application Event propagation framework? Choose
2 answers
A. Bubble

B. Capture

C. Default

A

B. Capture

C. Default

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
22
Q
A developer must create a CreditcardPayment class that provides an implementation of an existing Payment class. Public virtual class Payment { public virtual void makePayment(Decimal amount) { /*implementation*/
} } Which is the correct implementation?
A. Public class CreditCardPayment extends Payment {
public virtual void makePayment(Decimal amount) { /*implementation*/ }
}
B. Public class CreditCardPayment implements Payment {
public override void makePayment(Decimal amount) { /*Implementation*/ }
}
C. Public class CreditCardPayment implements Payment {
public virtual void makePayment(Decimal amount) { /*implementation*/ }
}
D. Public class CreditcardPayment extends Payment {
public override void makePayment(Decimal amount) { /*implementation*/ }
}
A
D. Public class CreditcardPayment extends Payment {
public override void makePayment(Decimal amount) { /*implementation*/ }
}
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
23
Q

Which code displays the content of Visualforce page as PDF?
A.

B.

C.

D.

A

D.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
24
Q
A developer is creating a test coveragefor a class and needs to insert records to validate functionality. Which method annotation should be used to create records for every method in the test class?
A. @PreTest

B. @TestSetup

C. @isTest(SeeAllData=True)

D. @BeforeTest

A

B. @TestSetup

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
25
Q

When using SalesforceDX, what does a developer need to enable to create and manage scratch orgs?
A. Environment Hub

B. Production

C. Dev Hub

D. Sandbox

A

C. Dev Hub

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
26
Q

Which two operations can be performed using a formula field? Choose 2 answers
A. Calculating a score on a Lead based on the information from another field

B. Displaying an Image based on the Opportunity Amount

C. Triggering a Process Builder

D. Displaying the last four digits of an encrypted Social Security number

A

A. Calculating a score on a Lead based on the information from another field

B. Displaying an Image based on the Opportunity Amount

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
27
Q

What are two characteristics related to formulas? Choose 2 answers.
A. Formulas can reference values in related objects.

B. Formulas are calculated at runtime and are notstored in the database.

C. Fields that are used in a formula field can be deleted or edited without the formula.

D. Formula can reference themselves.

A

A. Formulas can reference values in related objects.

B. Formulas are calculated at runtime and are notstored in the database.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
28
Q

team of many developers work in their own individual orgs that have the same configuration at the production org. Which type of org isbest suited for this scenario?
A. Full Sandbox

B. Developer Edition

C. Partner Developer Edition

D. Developer Sandbox

A

D. Developer Sandbox

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
29
Q

A developer needs to create a custom button for the Account object that, when clicked, will perform a series of calculation and redirect the user to a custom visualforce page.
Which three attributes need to be defined with values in the tag to accomplish this?

A. action
B. renderAs
C. standardController
D. readOnly
E. extensions
A

A. action
E. extensions
C. standardController

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
30
Q

In the following example, which sharing context will myMethod execute when it is invoked?
A. Sharing rules Ail be enforced by the instantiating class

B. Sharing rules will not be enforced for the running user.

C. Sharingrules will be inherited from the calling context.

D. Sharing rules Ml be enforced for the running user.

A

C. Sharingrules will be inherited from the calling context.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
31
Q

What is an example of a polymorphic lookup field in Salesforce? Review Ans
A. The Parentid field on the standard Account object

B. The Whatld field on the standard Event object

C. A custom field, Link__c, on the standard Contact object that looks up to an Account or a Campaign

D. The LeadId and Contactid fields on the standard Campaign Member object

A

D. The LeadId and Contactid fields on the standard Campaign Member object

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
32
Q

Which two statements are true about using the @testSetup annotation in an Apex test class?
Choose 2 answers
A. The @testSetup annotation cannot be used when the @isTest(SeeAllData=True) annotation is used.
B. Test data is inserted once for all test methods in a class.
C. Records created in the @testSetup method cannot be updates in individual test methods.
D. The @testSetup method is automatically executed before each test method in the test class is executed.

A
A. The @testSetup annotation cannot be used when the @isTest(SeeAllData=True) annotation is used.
D. The @testSetup method is automatically executed before each test method in the test class is executed.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
33
Q

Universal Containers decides to use exclusively declarative development to build out a new Salesforce application. Which three options should be used to build out the database layer for the application? Choose 3 answers
A. Triggers

B. Custom Objects and Fields

C. Roll-Up Summaries

D. Relationships

E. Process Builder

A

C. Roll-Up Summaries

D. Relationships

E. Process Builder

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
34
Q

What are three ways for a developer to execute tests in an org? Choose 3.
A. Bulk API

B. Tooling API

C. Setup Menu

D. Salesforce DX

E. Metadata API.

A

B. Tooling API

C. Setup Menu

D. Salesforce DX

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
35
Q

A developer needs to create a baseline set of data (Accounts, Contacts, Products, Assets) for anentire suite of test allowing them to test independent requirements various types of Salesforce Cases.
Which approach can efficiently generate the required data for each unit test?
A. Create test data before Test.startTest() in the unit test.

B. Add @isTest(seeAllData=true) at the start of the unit test class.

C. Use @TestSetup with a viod method.

D. Create a nock using the Stud API

A

C. Use @TestSetup with a viod method.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
36
Q

A developer uses a loop to check eachContact in a list. When a Contact with the Title of
“Boss” is found, the Apex method should jump to the first line of code outside of the for loop.
Which Apex solution will let the developer implement this requirement?
A. Next

B. Exit

C. break;

D. Continue

A

C. break;

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
37
Q

Which three operations affect the number of times a trigger can fire?
Choose 3 answers
A. Workflow Rules

B. Email messages

C. Criteria-based Sharing calculations

D. Process Flows

E. Roll-Up Summary fields

A

A. Workflow Rules
D. Process Flows

E. Roll-Up Summary fields

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
38
Q

Universal Containers stores the availability date on each Line Item of an Order and Orders are only shipped when all of the Line Items are available. Which method should be used tocalculate the estimated ship date for an Order?
A. Use a CEILING formula on each of the Latest availability date fields.

B. Use a Max Roll-Up Summary field on the Latest availability date fields.

C. Use a DAYS formula on each of the availability date fields and a COUNT Roll-Up Summary field on the Order.

D. Use a LATEST formula on each of the latest availability date fields.

A

B. Use a Max Roll-Up Summary field on the Latest availability date fields.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
39
Q

Refer to the follofowing code snippet for an environment has more than 200 Accounts belongingto the Technology’ industry:
for(Account thisAccount : [Select Id, Industry from Account LIMIT 150]){
if(thisAccount.Industry == “Technology”){
thisAccount.Is_Tech_c = true;
}
update thisAccount;
}

When the code execution, which two events occur as a result of the Apex transaction?
Choose 2 answers
A. If executed in an asynchronous context, the apex transaction is likely to fall by exceeding the DML governor limit

B. If executed In a synchronous context, the apex transaction is likely to fall by exceeding the DHL governor limit.

C. The Apex transaction succeeds regardless of any uncaught exception and all processed accounts are updated.

D. The Apex transaction fails with the following message. “SObjectrow was retrieved via SOQL without querying the requested field Account.Is.Tech__c’’.

A

D. The Apex transaction fails with the following message. “SObjectrow was retrieved via SOQL without querying the requested field Account.Is.Tech__c’’.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
40
Q

What can used to delete components from production?
A. A change set deployment with the delete option checked

B. A change set deployment with a destructivechanges XML file

C. An ant migration tool deployment withdestructivechanges xml file and the components to delete in the package .xml file

D. An ant migration tool deployment with a destructivechanges XML file and an empty package .xml file

A

C. An ant migration tool deployment withdestructivechanges xml file and the components to delete in the package .xml file

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
41
Q
A developer must create an Apex class,contactcontroller, that a Lightning component can use to search for Contact records. User of the Lightning component should only be able to search Contact records to which they have access. Which two will restrict the records correctly?
A. public without sharing class ContactController

B. public inherited sharing class ContactController

C. public with sharing class ContactController

D. public class ContactController

A

B. public inherited sharing class ContactController

C. public with sharing class ContactController

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
42
Q

Given the following Apex statement:
Account myAccount = [SELECT Id, Name FROM Account];
What occurs when more than one Account is returned by the SOQL query?
A. The first Account returned is assigned tomyAccount.

B. The variable,myAccount, is automatically cast to the List data type.

C. An unhandled exception is thrown and the code terminates.

D. The query fails and an error is written to the debuglog.

A

C. An unhandled exception is thrown and the code terminates.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
43
Q

A Next Best Action strategy uses an Enhance Element that invokes an Apex method to determine a discount level for a Contact, based on a number of factors. What is the correct definition of the Apex method?
A. @InvocableMethod
global Recommendation getLevel (ContactWrapper input)
{ /implementation/ }

B. @InvocableMethod
globalList> getLevel(List input)
{ /implementation/ }

C. @InvocableMethod
global static List> getLevel(List input)
{ /implementation/ }

D. @InvocableMethod
global static ListRecommendation getLevel(List input)
{ /implementation/ }

A

C. @InvocableMethod
global static List> getLevel(List input)
{ /implementation/ }

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
44
Q

A developer wants to invoke on outbound message when a record meets aspecific criteria.
Which three features satisfy this use case?
Choose 3 answer
A. workflows can be used to check the record criteria and send an outbound message.

B. Process builder can be used to check the record criteria and send an outbound messagewithout Apex Code.

C. Approval Process has the capacity to check the record criteria and send an outbound message without Apex Code

D. Visual Workflow canbe used to check the record criteria and send an outbound message without Apex Code.

E. Process builder can be used to check the record criteria andsend an outbound message with Apex Code.

A

A. workflows can be used to check the record criteria and send an outbound message.
C. Approval Process has the capacity to check the record criteria and send an outbound message without Apex Code
E. Process builder can be used to check the record criteria andsend an outbound message with Apex Code.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
45
Q

A developer needs to confirm that a Contact trigger works correctly without changing the organization’s data.
what should the developer do to test the Contact trigger?
A. Use Deploy from the VSCode IDE to display an ‘insert Contact’ Apex class.

B. Use the New button on the Salesforce Contacts Tab to create a new Contact record.

C. Use the Test menu on the Developer Console to run all test classes for the Contact trigger

D. Use the Open execute Anonymous feature on the Developer Console to run an ‘insert Contact’ DML statement

A

C. Use the Test menu on the Developer Console to run all test classes for the Contact trigger

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
46
Q

Which exception type cannot be caught ?
A. CalloutException

B. LimitException

C. NoAccessException

D. A custom Exception

A

B. LimitException

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
47
Q

A developer is asked to create a Visualforce page that displays some Account fields as well as fields configured on the page layout for related Contacts.
How should the developer implement this request?
A. Create a controller extension.

B. Use the tag.

C. Add a method to the standard controller.

D. Use the tag.

A

B. Use the tag.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
48
Q

developer wants to mark eachAccount in a List as either or Inactive based on the LastModified field value being more than 90 days.
Which Apex technique should the developer use?
A. A for loop, with an if/else statement inside

B. AnIf/else statement, with a for loop inside

C. A Switch statement, with a for loop inside

D. A for loop, with a switch statement inside

A

A. A for loop, with an if/else statement inside

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
49
Q

?An Approval Process is defined in the Expense_Item__c. A business rule dictates that whenever a user changes the Status to ‘Submitted’ on an Expense_Report__c record, all the Expense_Item__c records related to the expense report must enter the approval process individually. Which approach should be used to ensurethe business requirement is met?
A. Create a Process Builder on Expense_Report__c to mark the related Expense_Item__c as submittable and trigger on Expense_item__c to submitthe records for approval.

B. Create a Process Builder on Expense_Report__c with an ‘Apex’ action type to submit all related Expense_Item__c records when the criteria is met.

C. Create two Process Builder, one on Expense_Report__c to mark the related Expense_Item__c as submittable and the second on Expense_Item__c to submit the records for approval.

D. Create a Process Builder on Expense_Report__c with a ‘Submit for Approval’ action type to submit all related Expense_Item__c records when the criteria is met.

A

C. Create two Process Builder, one on Expense_Report__c to mark the related Expense_Item__c as submittable and the second on Expense_Item__c to submit the records for approval.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
50
Q

A developer has an integer variable called maxAttempts. The developer meeds to ensure that once maxAttempts is initialized, it preserves its value for the lenght of the Apex transaction; while being able to share the variable’s state between trigger executions. How should the developer declare maxAttempts to meet theserequirements?
A. Declare maxattempts as a constant using the static and final keywords

B. Declare maxattempts as avariable on a helper class

C. Declare maxattempts as a member variable on the trigger definition.

D. Declare maxattempts as a private static variable on a helper class

A

A. Declare maxattempts as a constant using the static and final keywords

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
51
Q

?Which three process automations can immediately send an email notification to the owner of anOpportunity when its Amount is changed to be greater than $10,000? Choose 3 answers
A. Flow Builder

B. Approval Process

C. Workflow Rule

D. Escalation Rule

E. Process Builder

A

B. Approval Process

C. Workflow Rule
E. Process Builder

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
52
Q

Which three web technologies can be integrated into a Visualforce page? (Choose three.)
A. Java

B. HTML

C. JavaScript

D. CSS

E. PHP

A

B. HTML

C. JavaScript

D. CSS

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
53
Q
A developer considers the following snippet of code:
boolean isOk;
integer x;
string theString ='Hello';
if(isOk == false && theString == 'Hello'){
x=1;
}
else if(isOk == true && theString == 'Hello'){
x=2;
}
else if(isOk != null && theString == 'Hello'){
x=3;
} else{ x=4; }

Based on this code, what is the value of x?
A. 3

B. 2

C. 4

D. 1

A

C. 4

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
54
Q

Given the following trigger implementation:
trigger leadTrigger on Lead (before update){
final ID BUSINESS_RECORDTYPEID = ‘012500000009Qad’;
for(Lead thisLead : Trigger.new){
if(thisLead.Company != null &&thisLead.RecordTypeId != BUSINESS_RECORDTYPEID){ thisLead.RecordTypeId = BUSINESS_RECORDTYPEID;
}
}
}
The developer receives deployment errors every time a deployment is attempted from Sandbox to Production.
What should thedeveloper do to ensure a successful deployment?
A. Ensure the deployment is validated by a System Admin user on Production.

B. Ensure BUSINESS_RECORDTYPEIDis pushed as part of the deployment components.

C. Ensure a record type with an ID of BUSINESS_RECORDTYPEID exists on Production prior to deployment.

D. Ensure BUSINESS_RECORDTYPEID is retrieved using Schema.Describe calls.

A

C. Ensure a record type with an ID of BUSINESS_RECORDTYPEID exists on Production prior to deployment.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
55
Q
Which three code lines are required to create a Lightning component on aVisualforce page? Choose 3 answers
A. $Lightning.useComponent
B. 
C. $Lightning.use
D. 
E. $Lightning.createComponent
A

C. $Lightning.use
D.
E. $Lightning.createComponent

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
56
Q

Refer to the following code that runs in an Execute Anonymous block:

query is processing 20,000 records

A. The transaction will succeed and the first ten thousand records will be committed to the database.

B. The total numberof DML statements will be exceeded.

C. In an environment where the full result set is returned, what is a possible outcome of this code?

D. The total number of records processed as a result of DML statements will be exceeded

A

D. The total number of records processed as a result of DML statements will be exceeded

limit is 10,000

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
57
Q

A developer iscreating a page that allows users to create multiple Opportunities. The developer is asked to verify the current user’s default } | Opportunity record type, and set certain default values based on the record type before inserting the record. i, J Calculator How can the developer find the current user’s default record type? ns
A. o Use Opportunity. SObjectType.getDescribe().getRecordTypelnfos() to get a list of record types, and iterate through them until [ J isDefaultRecordTypeMapping() is true. Pencil & Paper |

B. Query the Profile where the ID equals userInfo.getProfileID() and then use the profile.Opportunity.getDefaultRecordType() | | method. ] |

C. Use the Schema.userlnfo.Opportunity.getDefaultRecordType() method. < Create the opportunity and check theopportunity.recordType before inserting, which will have the record ID of the current Dal user’s default record type.

A

A. o Use Opportunity. SObjectType.getDescribe().getRecordTypelnfos() to get a list of record types, and iterate through them until [ J isDefaultRecordTypeMapping() is true. Pencil & Paper |

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
58
Q

A developer created a Visualforce page and custom controller to display the account type field as shown below. Custom controller code: public class customCtrlr{ private Account theAccount; public String actType; public customCtrlr() { theAccount = [SELECT Id, Type FROM Account WHERE Id = :apexPages.currentPage().getParameters().get(‘id’)]; actType

= theAccount.Type; } } Visualforce page snippet: The Account Type is {!actType} The value of the account type field is not being displayed correctly on the page. Assuming the custom controller is property referenced on the Visualforce page, what should the developer do to correct the problem?
A . Add a getter method for the actType attribute.
B . Change theAccount attribute to public.
C . Convert theAccount.Type to a String.
D . Add with sharing to the custom controller.

A

A . Add a getter method for the actType attribute.

https://developer.salesforce.com/docs/atlas.en-us.pages.meta/pages/pages_controller_custom.htm

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
59
Q

?Which scenario is valid for execution by unit tests?
A. Generate a Visualforce PDF with geccontentAsPDF ().

B. Load data from a remote site with a callout.

c. Set the created date of a record using a system method.
d: Execute anonymous Apex as a different user.

A
  1. Set the created date of a record using a system method.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
60
Q

Which scenario is invalid for execution by unit tests?
A. Loading test data in place of user input for Flows.

B. Loading the standard Pricebook ID using a system method

C. Executing methods for negative test scenarios

D. Executing methods as different users.

A

A. Loading test data in place of user input for Flows.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
61
Q
A developer must implement a CheckPaymentProcessor class that provides check processing payment capabilities that adhere to what defined for payments in the PaymentProcessor interface. public interface PaymentProcessor { void pay(Decimal amount); } Which is the correct implementation to use the PaymentProcessor interface class?
A. Public class CheckPaymentProcessor implements PaymentProcessor {
public void pay(Decimal amount);
}
B. Public class CheckPaymentProcessor implements PaymentProcessor {
public void pay(Decimal amount) {}
}
C. Public class CheckPaymentProcessor extends PaymentProcessor {
public void pay(Decimal amount);
}
D. Public class CheckPaymentProcessor extends PaymentProcessor {
public void pay(Decimal amount) {}
}
A
A. Public class CheckPaymentProcessor implements PaymentProcessor {
public void pay(Decimal amount);
}
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
62
Q

Which Salesforce feature allows a developer to see when a user lastlogged in to Salesforce if real-time notification is not required?
A. Calendar Events

B. Event Monitoring Log

C. Asynchronous Data Capture Events

D. Developer Log

A

B. Event Monitoring Log

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
63
Q

Assuming that ‘name; is a String obtained by an tag on a Visualforce page.
Which two SOQL queries performed are safe from SOQL injections? Choose 2 answers
A. String query = ‘%’ + name + ‘%’;
List results = [SELECT Id FROM Account WHERE Name LIKE :query];

B. String query =’SELECT Id FROM Account WHERE Name LIKE '’%’ + name.noQuotes() + ‘%'’; List results = Database.query(query);

C. String query = ‘SELECT Id FROM Account WHERE Name LIKE '’%’ +
String.escapeSingleQuotes(name) + ‘%'’;
List results= Database.query(query);

D. String query = ‘SELECT Id FROM Account WHERE Name LIKE '’%’ + name + ‘%'’; List results = Database.query(query);

A

A. String query = ‘%’ + name + ‘%’;
List results = [SELECT Id FROM Account WHERE Name LIKE :query];
C. String query = ‘SELECT Id FROM Account WHERE Name LIKE '’%’ +
String.escapeSingleQuotes(name) + ‘%'’;
List results= Database.query(query);

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
64
Q

What are three considerations when usingthe @InvocableMethod annotation in Apex?
Choose 3 answers
A. A method using the @InvocableMethod annotation can have multiple input parameters.

B. A method using the @InvocableMethod annotation must define a return value.

C. A method using the @InvocableMethod annotation must be declared as static

D. Only one method using the @InvocableMethod annotqation can be defined per Apex class.

E. A method using the @InvocableMethod annotation can be declared as Public or Global.

A

C. A method using the @InvocableMethod annotation must be declared as static

D. Only one method using the @InvocableMethod annotqation can be defined per Apex class.

E. A method using the @InvocableMethod annotation can be declared as Public or Global.

https://developer.salesforce.com/docs/atlas.en-us.236.0.apexcode.meta/apexcode/apex_classes_annotation_InvocableMethod.htm

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
65
Q

which statement is true regarding execution order when triggers are associated to the same object and event?
A. Trigger execution order cannot be guaranteed.

B. Triggers are executed alphabetically by trigger name.

C. executed In the order theyare modified.

D. Triggers are executed in the order they are created.

A

A. Trigger execution order cannot be guaranteed.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
66
Q
?A developer must modify the following code snippet to prevent the number of SOQL queries issued from exceeding the platform governor limit. public class without sharing OpportunityService( public static List getOpportunityProducts(Set opportunityIds){ List oppLineItems = new List(); for(Id thisOppId : opportunityIds){ oppLineItems.addAll([Select Id FROM OpportunityLineItems WHERE OpportunityId = :thisOppId)]; } return oppLineItems; } } The above method might be called during a trigger execution via a Lightning component. Which technique should be implemented to avoid reaching the governor limit?
A. Use the System.Limits.getlimitQueries() method to ensure the number of queries is less than 100.

B. Use the System.Limits.getQueries() method to ensure the number of queries is lessthan 100.

C. Refector the code above to perform the SOQL query only if the Set of opportunityIds contains less 100 Ids.

D. Refactor the code above to perform only one SOQL query, filtering by the Set of opportunityIds.

A

D. Refactor the code above to perform only one SOQL query, filtering by the Set of opportunityIds.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
67
Q

A workflow updates the value of a custom field for an existing Account.
How can a developer access the updated custom field value from a trigger?
A. By writing an After Update trigger andaccessing the field value from Trigger.old

B. By writing, a Before Update trigger and accessing the field value from Trigger.new

C. By writing an After Insert trigger and accessing the field value from Trigger.old

D. By writing a Before Insert trigger and accessing the field value from Trigger.new

A

B. By writing, a Before Update trigger and accessing the field value from Trigger.new

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
68
Q
Cloud Kicks Fitness, an ISV Salesforce partner, is developing a managed package application. One of theapplication modules allows the user to calculate body fat using the Apex class,BodyFat, and its method,calculateBodyFat(). The product owner wants to ensure this method is accessible by the consumer of the application when developing customizations outside the ISV's package namespace.
Which approach should a developer take to ensurecalculateBodyFat()is accessible outside the package namespace?
A. Declare the class and method using the public access modifier.

B. Declare the class as global and use thepublic access modifier on the method.

C. Declare the class and method using the global access modifier.

D. Declare the class as public and use the global access modifier on the method.

A

C. Declare the class and method using the global access modifier.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
69
Q

What are two ways that a controller and extension can be specified on a Visualforce page?
Choose 2 answers
A. Qo apex:page standardController=”Account” extensions=”myControllerExtension”

B. a@pex:page=Account extends=”myControllerExtension”

C. apex:page controller=”Account” extensions=”myControllerExtension””

D. apex:page controllers=”Account, myControllerExtension”

A

A. Qo apex:page standardController=”Account” extensions=”myControllerExtension”
C. apex:page controller=”Account” extensions=”myControllerExtension””

https://www.marks4sure.com/pdi-platform-developer-i-wi22-questions.html

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
70
Q
Which three statements are true regarding custom exceptions in Apex? (Choose three.)
A. A custom exception class name must end with "Exception".

B. A custom exception class cannot contain member variables or methods.

C. A custom exception class must extend the system Exception class.

D. A custom exception class can implement one or many interfaces.

E. A custom exception class can extend other classes besides the Exception class.

A
A. A custom exception class name must end with "Exception".
C. A custom exception class must extend the system Exception class.
D. A custom exception class can implement one or many interfaces.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
71
Q

What is the order of operations when a record is saved in Salesforce?
A. Workflow, process flows, triggers, commit

B. Workflow, triggers, process flows, commit

C. Triggers, workflow, process flows, commit

D. Process flows, triggers, workflow, commit

A

C. Triggers, workflow, process flows, commit

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
72
Q

Universal Containers wants to back up all of the data and attachments in its Salesforce org once month. Which approach should a developer use to meet this requirement?
A. Use the Data Loader command line.

B. Define a Data Export scheduled job.

C. Create a Schedulable Apex class.

D. Schedule a report.

A

B. Define a Data Export scheduled job

73
Q

What is the value of the Trigger.old context variable in a Before Insert trigger?
A. An empty list of sObjects

B. null

C. A list of newly created sObjects without IDS

D. Undefined

A

B. null

74
Q

A developer of Universal Containers is tasked with implementing a new Salesforce application that must be able to by their company’s Salesforce administrator.
Which three should be considered for building out the business logic layer of the application? Choose 3 answers
A. Scheduled Jobs

B. Invocable Actions

C. Process Builder

D. Workflows

E. validation Rules

A

C. Process Builder

D. Workflows

E. validation Rules

75
Q

A developer needs to join data received from an integration with an external system with parent records in Salesforce. The data set does not contain the Salesforce IDs of the parent records, but it does have a foreign key attribute that can be used to identify the parent.
Which action will allow the developer to relate records in the data model without knowing the Salesforce ID?
A. Create and populate a custom field on the parent object marked as an External ID.

B. Create a custom field on the child object of type Foreign Key

C. Create a custom field on the child object of type External Relationship.

D. Create and populate a custom field on the parent object marked as Unique

A

A. Create and populate a custom field on the parent object marked as an External ID.

76
Q

block:

A. The total number of records processed as a result of DML statements will be exceeded

B. The total number of DML statements will be exceeded.

C. The total number of records processed as a result of DML statements will be exceeded.

D. In an environment where the full result set is returned, what is a possible outcome of this code?

E. The transaction will succeed and the first ten thousand records will be committed to the database.

A

A. The total number of records processed as a result of DML statements will be exceeded

77
Q

Which aspect of Apex programming is limited due to multitenancy?
A. The number of records returned from database queries

B. The number of active Apex classes

C. The number of methods in an Apex Class

D. The number of records processed in a loop

A

A. The number of records returned from database queries

78
Q

Example 1:
AggregateResult[] groupedResults = [SELECT CampaignId, AVG(Amount) FROM Opportunity GROUP BY CampaignId]; for (AggregateResult ar : groupedResults) {
System.debug(‘Campaign ID’ + ar.get(‘CampaignId’));
System.debug(‘Average amount’ + ar.get(‘expr0’)); }
Example 2:
AggregateResult[] groupedResults = [SELECT CampaignId, AVG(Amount) theAverage FROM Opportunity GROUP BY CampaignId]; for (AggregateResult ar : groupedResults) {
System.debug(‘Campaign ID’ + ar.get(‘CampaignId’));
System.debug(‘Average amount’ + ar.get(‘theAverage’)); }
Example 3:
AggregateResult[] groupedResults = [SELECT CampaignId, AVG(Amount) FROM Opportunity GROUP BY CampaignId]; for (AggregateResult ar : groupedResults) {
System.debug(‘Campaign ID’ + ar.get(‘CampaignId’));
System.debug(‘Average amount’ + ar.get.AVG()); }
Example 4:
AggregateResult[] groupedResults = [SELECT CampaignId, AVG(Amount) theAverage FROM Opportunity GROUP BY CampaignId]; for (AggregateResult ar : groupedResults) {
System.debug(‘Campaign ID’ + ar.get(‘CampaignId’));
System.debug (‘Average amount’ + ar.theAverage); }
Which two of the examples above have correct System.debug statements? (Choose two.)

A

A. Example 1

B. Example 2

79
Q

A developer created a Visualforce page and custom controller to display the account type field as shown below. Custom controller code:

public class customCtrlr{
    private Account theAccount;
    public String actype;
    public customCtrlr() {
        theAccount=[SELECT Id, Type FROM Account where Id= :ApexPages.currentPage().getParameters().get('id')];
        acType=theAccount. Type;
    }
}
Visualforce page snippet:

The Account type is {!acType}

The value of the account type field is not being displayed correctly on the page. Assuming the custom controller is properly referenced on the Visualforce page, what should the developer do to correct the problem?

A. Add a getter method for the actType attribute.

B. Change theAccount attribute to public.

C. Convert theAccount.Type to a String.

D. Add with sharing to the custom controller.

A

A. Add a getter method for the actType attribute.

80
Q

If apex code executes inside the execute() method of an Apex class when implementing the Batchable interface, which statement are true regarding governor limits? Choose 2 answers
A. The Apex governor limits are relaxed while calling the constructor of the Apex class.
B. The Apex governor limits might be higher due to the asynchronous nature of the transaction.
C. The apex governor limits are reset for each iteration of the execute() method.
D. The Apex governor limits cannot be exceeded due to the asynchronous nature of the transaction,

A

B. The Apex governor limits might be higher due to the asynchronous nature of the transaction.
C. The apex governor limits are reset for each iteration of the execute() method.

81
Q

A development team wants to use a deployment script lo automatically deploy lo a sandbox during their development cycles.
Which two tools can they use to run a script that deploys to a sandbox?
Choose 2 answers
A. SFDX CLI
B. Developer Console
C. Ant Migration Tool
D. Change Sets

A

A. SFDX CLI

C. Ant Migration Tool

82
Q
Which statement should be used to allow some of the records in a list of records to be inserted rf others fail to be inserted?
A. insert (records, false)
B. Database.insert(records, false)
C. insert records
D. Database.insert(records, true)
A

B. Database.insert(records, false)

83
Q
class myClass(){
class CustomException extends QueryException ()
public static Account aQuery()
Account theAccount;
try {
system.debug ('Querying Accounts.') ;
theAccount = [SELECT Id FROM Account WHERE CreatedDate > TODAY];
}
catch (CustomException ex) {
system.debug ('Custom Exception.');
}
catch (QueryException ex){
system.debug ('Query Exception.') ;
}
finally{
system.debug ('Done.");
}
return theAccount;
}

A. Querying Accounts. Custom Exception Done. B. Querying Accounts. Custom Exception.
C. Querying Accounts. Query Exception.
D. Querying Accounts. Query Exception. Done

A

D. Querying Accounts. Query Exception. Done

84
Q

The sales management team at Universal Containers requires that the Lead Source field of the Lead record be populated when a Lead is converted.
What should be used to ensure that a user populates the Lead Source field prior to converting a Lead?
A. Formula Field B. workflow Rule C. Validation Rule D. Process Builder

A

Validation Rule

85
Q

A developer has a single custom controller class that works with a Visualforce Wizard to support creating and editing multiple subjects. The wizard accepts data from user inputs across multiple Visualforce pages and from a parameter on the initial URL.
Which three statements are useful inside the unit test to effectively test the custom controller? Choose 3 answers
A. insert pageRef.
B.ApexPages.CurrentPage().getParameters().put(‘input', ‘TestValue’);
C. Test.setCurrentPage(pageRef);
D. public ExtendedController(ApexPages StandardController cntrl) { }
E. String nextPage - controller.save().getUrl();

A

B.ApexPages.CurrentPage().getParameters().put(‘input', ‘TestValue’);
C. Test.setCurrentPage(pageRef);
E. String nextPage - controller.save().getUrl();

86
Q
Which three Salesforce resources can be accessed from a Lightning web component? Choose 3 answers
A. All external libraries
B. Content asset files
C. Static resources
D. Third-party web components 
E. SVG resources
A

A. All external libraries
C. Static resources
E. SVG resources

87
Q
Which three resources in an Azure Component can contain JavaScript functions? 
A. Controllers
B. Style
C. Renderer
D. helper
E. Design
A

A. Controllers
C. Renderer
D. helper

88
Q

A developer created these three Rollup Summary fields in the custom object, Project_ct,
Total_Timeheets__c;
Total_Approved_Timeheets__c;
Total_Rejected_Timeheets__c
The developer is asked to create a new field that shows the ratio between rejected and approved timesheets for a given project.
Which should the developer use to Implement the business requirement in order to minimize maintenance overhead?
A. Formula field
B. Record-triggered Flow
C. Process Builder
D. Apex Trigger

A

A. Formula field

89
Q

A developer is creating a Lightning web component to show a list of sales records.
The Sales Representative user should be able to see the commission-field on each record. The Sales
Assistance user should be able to see all field on the record except the commission field.
How should this be enforced so that the component works for both users without showing any
errors?
A. Use with SECURITY_EMFoRCED in the SOQL that fetches the data for the component.
B. Use Lightning Data Service to get the collection of sales records.
C. Use Lightning Locker Service to enforce sharing rules and field-level security.
D. Use security. stripInaccessible to remove fields inaccessible to the current user

A

D. Use security. stripInaccessible to remove fields inaccessible to the current user

90
Q

?Universal Container(UC) wants to lower its shipping cost while making the shipping process
more efficient. The Distribution Officer advises UC to implement global addresses to allow multiple
Accounts to share a default pickup address. The Developer is tasked to create the supporting object
and relationship for this business requirement and uses the Setup Menu to create a custom object
called “Global Address”. Which field should the developer ad to create the most efficient model that
supports the business need?
A. Add a Lookup field on the Global Address object to the Account object
B. Add a Master-Detail field on the Account object to the Global Address object
C. Add a Master-Detail field on the Global Address object to the Account object.
D. Add a Lookup field on the Account object to the Global Address object.

A

D. Add a Lookup field on the Account object to the Global Address object.

91
Q
Which annotation exposes an Apex class as a RESTful web service?
A. HttpInvocable
B. AuraEnabled
C. RemoteAction
D. RestResource
A

D. RestResource

92
Q

Universal Containers decides to use purely declarative development to build out a new
Salesforce application.
Which three options can be used to build out the business logic layer for this application?
Choose 3 answers
A. Flow Builder
B. Validation Rules
C. Process builder

A

A. Flow Builder
B. Validation Rules
C. Process builder

93
Q

Universal Containers recently transitioned from Classic to Lighting Experience. One of its
business processes requires certain value from the opportunity object to be sent via HTTP REST
callout to its external order management system based on a user-initiated action on the opportunity
page. Example values are as follow Name Amount Account Which two methods should the developer
implement to fulfill the business requirement? (Choose 2 answers)
A. Create an after update trigger on the Opportunity object that calls a helper method using @Future(Callout=true) to perform the HTTP REST callout.
B. Create a Visualforce page that performs the HTTP REST callout, and use a Visualforce quick action to expose the component on the Opportunity detail page.
C. Create a Lightning component that performs the HTTP REST callout, and use a Lightning Action to expose the component on the Opportunity detail page.
D. Create a Process Builder on the Opportunity object that executes an Apex immediate action to perform the HTTP REST callout whenever the Opportunity is updated.

A

B. Create a Visualforce page that performs the HTTP REST callout, and use a Visualforce quick action to expose the component on the Opportunity detail page.

C. Create a Lightning component that performs the HTTP REST callout, and use a Lightning Action to expose the component on the Opportunity detail page.

94
Q

A developer needs to confirm that a Contact trigger works correctly without changing the organization’s dat a. what should the developer do to test the Contact trigger?
A. Use Deploy from the VSCode IDE to display an ‘insert Contact’ Apex class.
B. Use the New button on the Salesforce Contacts Tab to create a new Contact record.
C. Use the Test menu on the Developer Console to run all test classes for the Contact trigger
D. Use the Open execute Anonymous feature on the Developer Console to run an ‘insert Contact’
DML statement

A

C. Use the Test menu on the Developer Console to run all test classes for the Contact trigger

95
Q

A developer needs to create a baseline set of data (Accounts, Contacts, Products, Assets) for
an entire suite of test allowing them to test independent requirements various types of Salesforce
Cases.
Which approach can efficiently generate the required data for each unit test?
A. Create a nock using the Stud API
B. Create test data before Test.startTest() in the unit test.
C. Add @isTest(seeAllData=true) at the start of the unit test class.
D. Use @TestSetup with a viod method.

A

D. Use @TestSetup with a viod method.

96
Q

Given the following block code: try{ List retrievedRecords = [SELECT Id FROM
Account WHERE Website = null]; }catch(Exception e){ //manage exception logic } What should a developer do to ensure the code execution is disrupted if the retrievedRecordslist remains empty after the SOQL query?
A. Check the state of the retrievedRecords variable and use System.assert(false) if the variable is empty
B. Check the state of the retrieveRecords variable and throw a custom exception if the variable is
empty.
C. Replace the retrievedRecords variable declaration from ftount to a single Account.
D. Check the state of the retrievedRecords variable and access the first element of the list if the
variable is empty.

A

A. Check the state of the retrievedRecords variable and use System.assert(false) if the variable is
empty

97
Q

Given the following Anonymous Block:
List0);
for (Case thisCase: [Select Id, Status FROM Case LIMIT 50000) .
thisCase. Status=’Working’
casesToUpdate.add(thisCase);
try{
Database.update (casesToUpdate, false) ;
}catch (Exception e){
System.debug (e.getMessage))}
What should a developer consider for an environment that has over 10,000 Case records?
A. The transaction will succeed and changes will be committed.
B. The transaction will fail due to exceeding the governor limit.
C. The try/catch block will handle any DML exceptions thrown.
D. The try/catch block will handle exceptions thrown by governor limits.

A

A. The transaction will succeed and changes will be committed.

98
Q

A developer needs to update an unrelated object when a record gets saved. Which two
trigger types should the developer create?
A. Before update
B. Before insert
C. After update
D. After insert

A

A. Before update

B. Before insert

99
Q

A developer has an Apex controller for a Visualforce page that takes an ID as a URL parameter.
How should the developer prevent a cross site scripting vulnerability?
A. ApexPages.currentPage().getParameters().get(‘url_param’)
B. String.escapeSingleQuotes(ApexPages.currentPage().getParameters().get(‘url_param’))
C. String.ValueOf(ApexPages.currentPage().getParameters().get(‘url_param’))
D. ApexPages.currentPage().getParameters().get(‘url_param’).escapeHtml4()

A

D. ApexPages.currentPage().getParameters().get(‘url_param’).escapeHtml4()

100
Q

A developer needs to have records with specific field values in order to test a new Apex class.
What should the developer do to ensure the data is available to the test?
A. Use Anonymous Apex to create the required data.
B. Use Test.Loaddata () and reference a CSV file
C. Use SOQL to query the org for the required data.
D. Use Test.Loaddata () and reference a static resource.

A

D. Use Test.Loaddata () and reference a static resource.

101
Q
A developer must create a CreditcardPayment class that provides an implementation of an existing Payment class. Public virtual class Payment { public virtual void makePayment(Decimal amount) { /*implementation*/
} } Which is the correct implementation?
A. Public class CreditCardPayment implements Payment {
public virtual void makePayment(Decimal amount) { /*implementation*/ }
}
B. Public class CreditcardPayment extends Payment {
public override void makePayment(Decimal amount) { /*implementation*/ }
}
C. Public class CreditCardPayment implements Payment {
public override void makePayment(Decimal amount) { /*Implementation*/ }
}
D. Public class CreditCardPayment extends Payment {
public virtual void makePayment(Decimal amount) { /*implementation*/ }
}
A
B. Public class CreditcardPayment extends Payment {
public override void makePayment(Decimal amount) { /*implementation*/ }
}
102
Q
Universal Containers (UC) decided it will not to send emails to support personnel directly from Salesforce in the event that an unhandled exception occurs. Instead, UC wants an external system be notified of the error.
What is the appropriate publish/subscribe logic to meet these requirements?
A. Publish the error event using the Eventbus.publish() method and have the external system subscribe to the event using CometD.

B. Publish the error event using the addError() method and have the external system subscribe to the event using CometD.

C. Have the external system subscribe to the BatchApexError event, no publishing is necessary.

D. Publish the error event using the addError() method and write a trigger to subscribe to the event and notify the external system.

A

A. Publish the error event using the Eventbus.publish() method and have the external system subscribe to the event using CometD.

103
Q

A developer observes that an Apex test method fails in the Sandbox. To identify the issue, the developer copies the code inside the test method and executes it via the Execute Anonymous tool in the Developer Console. The code then executes with no exceptions or errors.
Why did the test method fail in the sandbox and pass in the Developer Console?

A. The test method has a syntax error in the code.
B. The test method does not use System.runAs to execute as a specific user.
C. The test method is calling an @future method.
D. The test method relies on existing data in the sandbox.

A

D. The test method relies on existing data in the sandbox.

104
Q

?What is the most efficient statement to retrieve the list of contacts?
The Job_Application__c custom object has a field that is a Master-Detail relationship to the Contact object, where the Contact object is the Master. As part of a feature implementation, a developer needs to retrieve a list containing all Contact records where the related Account Industry is ‘Technology’ while also retrieving the contact’s Job_Application__c records.
Based on the object’s relationships, what is the most efficient statement to retrieve the list of contacts?
A. [SELECT Id, (SELECT Id FROM Job_Applications_r) FROM Contact WHERE Account.Industry = ‘Technology’];
B. [SELECT Id, (SELECT Id FROM Job_Applications_r) FROM Contact WHERE Accounts.Industry = ‘Technology’];
C. [SELECT Id, (SELECT Id FROM Job_Applications_c) FROM Contact WHERE Accounts.Industry = ‘Technology’];
D. [SELECT Id, (SELECT Id FROM Job_Application_c) FROM Contact WHERE Account.Industry = ‘Technology’];

A

A. [SELECT Id, (SELECT Id FROM Job_Applications_r) FROM Contact WHERE Account.Industry = ‘Technology’];

105
Q

A Licensed_Professional__c custom object exist in the system with two Master-Detail fields for the following objects: Certification__c and Contact. Users with the “Certification Representative” role can access the Certification records they own and view the related Licensed Professionals records, however users with the
“Salesforce representative” role report they cannot view any Licensed professional records even though they own the associated Contact record. What are two likely causes of users in the “Sales Representative” role not being able to access the Licensed Professional records? Choose 2 answers
A. The organization’s sharing rules for Licensed_Professional__c have not finished their recalculation process.

B. The organization has a private sharing model for Certification__c, and Certification__c is the primary relationship in the Licensed_Professional__c object.

C. The organization has a private sharing model for Certification__c, and Contact is the primary relationship in the Licensed_Professional__c object

D. The organization recently modified the Sales representative role to restrict Read/Write access to Licensed_Professional__c

A

A. The organization’s sharing rules for Licensed_Professional__c have not finished their recalculation process.

B. The organization has a private sharing model for Certification__c, and Certification__c is the primary relationship in the Licensed_Professional__c object.

106
Q

Which two characteristics are true for Aura component events?
A. Only parent components that create subcomponents (either in their markup or programmatically) can handle events.

B. Calling event, stopPropagation ( ) may or may not stop the event propagation based of the current propagation phase.

C. The event propagates to every owner In the containment hierarchy.

D. If a container component needs to handle a component event, add a handleFacets=’’ attribute to Its handler.

A

B. Calling event, stopPropagation ( ) may or may not stop the event propagation based of the current propagation phase.

C. The event propagates to every owner In the containment hierarchy.

107
Q
Universal Containers (UC) uses a custom object called Vendor. The Vendor custom object has a Master-Detail relationship with the standard Account object. Based on some internal discussion, the UC administrator tried to change the Master-Detail relationship to a Lookup relationship but was not able to do so. What is a possible reason that this change was not permitted?
A. The Account object is included on a workflow on the Vendor object.

B. The Vendor object must use a Master-Detail field for reporting.

C. The Vendor records have existing values in the Account object.

D. The Account records contain Vendor roll-up summary fields.

A

D. The Account records contain Vendor roll-up summary fields.

108
Q

A custom object Trainer_c has a lookup field to another custom object Gym___c.
Which SOQL query will get the record for the Viridian City gym and it’s trainers?
A. SELECT ID FROM Trainer_c WHERE Gym__r.Name - Viridian City Gym’

B. SELECT Id, (SELECT Id FROM Trainers__r) FROM Gym_C WHERE Name =’Viridian City Gym’

C. SELECT Id, (SELECT Id FROM Trainers) FROM Gym_C WHERE Name - Viridian City Gym’

D. SELECT Id, (SELECT Id FROM Trainer_c) FROM Gym_c WHERE Name - Viridian City Gym’

A

B. SELECT Id, (SELECT Id FROM Trainers__r) FROM Gym_C WHERE Name =’Viridian City Gym’

109
Q
A developer is tasked to perform a security review of the ContactSearch Apex class that exists in the system.
Whithin the class, the developer identifies the following method as a security threat: List performSearch(String lastName){ return Database.query('Select Id, FirstName, LastName FROM Contact WHERE LastName Like %'+lastName+'%); } What are two ways the developer can update the method to prevent a SOQL injection attack? Choose 2 answers
A. Use the @Readonly annotation and the with sharing keyword on the class.

B. Use variable binding and replace the dynamic query with a static SOQL.

C. Use the escapeSingleQuote method to sanitize the parameter before its use.

D. Use a regular expression on the parameter to remove special characters.

A

B. Use variable binding and replace the dynamic query with a static SOQL.

C. Use the escapeSingleQuote method to sanitize the parameter before its use

110
Q

What are three techniques that a developer can use to invoke an anonymous block of code? (Choose three.)
A. Use the SOAP API to make a call to execute anonymous code.
B. Create a Visualforce page that uses a controller class that is declared without sharing.
C. Run code using the Anonymous Apex feature of the Developer’s IDE.
D. Type code into the Developer Console and execute it directly.
E. Create and execute a test method that does not specify a runAs() call.

A

A. Use the SOAP API to make a call to execute anonymous code.
C. Run code using the Anonymous Apex feature of the Developer’s IDE.
D. Type code into the Developer Console and execute it directly.

111
Q
Which Apex class contains methods to return the amount of resources that have been used for a particular governor, such as the number of DML statements?
A. Limits

B. Exception

C. OrgLimits

D. Messaging

A

A. Limits

112
Q

A custom picklist field, Food_Preference__c, exist on a custom object. The picklist contains the following options: ‘Vegan’,’Kosher’,’No Preference’. The developer must ensure a value is populated every time a record is created or updated. What is the most efficient way to ensure a value is selected every time a record is saved?
A. Set a validation rule to enforce a value is selected.

B. Mark the field as Required on the field definition.

C. Set “Use the first value in the list as the default value” as True.

D. Mark the field as Required on the object’s page layout.

A

B. Mark the field as Required on the field definition.

113
Q

What is the maximum number of SOQL queries used by the following code? List aList = [SELECT Id FROM Account LIMIT 5]; for (Account a : aList){ List cList = [SELECT Id FROM Contact WHERE AccountId = :a.Id); }
A. 6

B. 5

C. 1

D. 2

A

A. 6

114
Q

Application Events follow the traditional publish-subscribe model. Which method is used to fire an event?
A. Emit()

B. FireEvent()

C. RegisterEvent()

D. Fire()

A

D. Fire()

115
Q

A developer needs to have records with specific field values in order to test a new Apex class.
What should the developer do to ensure the data is available to the test?
A. Use Test.Loaddata () and reference a static resource.

B. Use SOQL to query the org for the required data.

C. Use Anonymous Apex to create the required data.

D. Use Test.Loaddata () and reference a CSV file

A

A. Use Test.Loaddata () and reference a static resource.

116
Q

Which three resources in an Aura Component can contain Javascript functions? Choose 3 answers
A. Helper

B. Renderer

C. Controller

A

A. Helper

B. Renderer

C. Controller

117
Q

A workflow updates the value of a custom field for an existing Account.
How can a developer access the updated custom field value from a trigger?
A. By writing an After Update trigger and accessing the field value from Trigger.old

B. By writing an After Insert trigger and accessing the field value from Trigger.old

C. By writing, a Before Update trigger and accessing the field value from Trigger.new

D. By writing a Before Insert trigger and accessing the field value from Trigger.new

A

C. By writing, a Before Update trigger and accessing the field value from Trigger.new

118
Q

When using SalesforceDX, what does a developer need to enable to create and manage scratch orgs?
A. Production

B. Dev Hub

C. Environment Hub

D. Sandbox

A

B. Dev Hub

119
Q

What are three considerations when using the @InvocableMethod annotation in Apex?
Choose 3 answers
A. A method using the @InvocableMethod annotation can have multiple input parameters.

B. Only one method using the @InvocableMethod annotqation can be defined per Apex class.

C. A method using the @InvocableMethod annotation can be declared as Public or Global.

D. A method using the @InvocableMethod annotation must define a return value.

E. A method using the @InvocableMethod annotation must be declared as static

A

B. Only one method using the @InvocableMethod annotqation can be defined per Apex class.

C. A method using the @InvocableMethod annotation can be declared as Public or Global.
E. A method using the @InvocableMethod annotation must be declared as static

120
Q
How many accounts will be inserted by the following block ofcode? for(Integer i = 0 ; i < 500; i++) { Account a = new Account(Name='New Account ' + i); insert a; }
A. 100

B. 0

C. 500

D. 150

A

B. 0

121
Q

A custom Visualforce controller calls the ApexPages,addMessage () method, but no messages are rendering on the page. Which component should be added to the Visualforce page to display the message?

A
122
Q

Which code displays the contents of a Visualforce page as a PDF?
A.

B.

C.

D.

A

D.

123
Q

A developer has a requirement to create an Order When an Opportunity reaches a “Closed-Won” status.
Which tool should be used to implement this requirement?
A. Process Builder

B. Lightning Component

C. Lightning

D. Apex trigger

A

A. Process Builder

124
Q

Universal Containers has an order system that uses an Order Number to identify an order for customers and service agents. Order will be imported into Salesforce.
A. Number with External ID

B. Indirect Lookup

C. Lookup

D. Direct Lookup

A

A. Number with External ID

125
Q

Which action causes a before trigger to fire by default for Accounts?
A. Updating addresses using the Mass Address update tool

B. Importing data using the Data Loader and the Bulk API

C. Renaming or replacing picklist

D. Converting Leads to Contact accounts

A

B. Importing data using the Data Loader and the Bulk API

126
Q

A developer needs an Apex method that can process Account or Contact records. Which method signature should the developer use?
A. Public void doWork(sObject theRecord)

B. Public void doWork(Account Contact)

C. Public void doWork(Record theRecord)

D. Public void doWork(Account || Contatc)

A

A. Public void doWork(sObject theRecord)

127
Q
The following Apex method is part of the ContactService class that is called from a trigger: public static void setBusinessUnitToEMEA(Contact thisContact){ thisContact.Business_Unit\_\_c = "EMEA" ; update thisContact; } How should the developer modify the code to ensure best practice are met?
A. Public static void setBusinessUnitToEMEA(List contacts){
for(Contact thisContact : contacts) {
thisContact.Business_Unit\_\_c = 'EMEA' ;
}
update contacts;
}

B. Public void setBusinessUnitToEMEA(List contatcs){
contacts[0].Business_Unit__c = ‘EMEA’ ;
update contacts[0];
}

C. Public static void setBusinessUnitToEMEA(Contact thisContact){
List contacts = new List();
contacts.add(thisContact.Business_Unit\_\_c = 'EMEA');
update contacts;
}
D. Public static void setBusinessUnitToEMEA(List contacts){
for(Contact thisContact : contacts){
thisContact.Business_Unit\_\_c = 'EMEA' ;
update contacts[0];
}
}
A
C. Public static void setBusinessUnitToEMEA(Contact thisContact){
List contacts = new List();
contacts.add(thisContact.Business_Unit\_\_c = 'EMEA');
update contacts;
}
128
Q

Which Lightning code segment should be written to declare dependencies on a Lightning component, c:accountList, that is used in a Visualforce page?

https://www.freecram.net/question/Salesforce.PDI.v2022-03-30.q75/which-lightning-code-segment-should-be-written-to-declare-dependencies-on-a-lightning-component-c-account

A. Option B

B. Option C

C. Option D

D. Option A

A

D. Option A

129
Q

What are two ways a developer can get the status of an enquered job for a class that queueable interface?
Choose 2 answers
A. Query the AsyncApexJob object

B. View the apex flex Queue

C. View the apex Jobs page

D. View the apex status Page

A

C. View the apex Jobs page

A. Query the AsyncApexJob object

130
Q

A developer identifies the following triggers on the Expense_c object:
* DeleteExpense,
* applyDefaultstoexpense
* validateexpenseupdate;
The triggers process before delete, before insert, and before update events respectively.
Which two techniques should the developer implement to ensure trigger best practice are followed?
A. Unify the before insert and before update triggers and use Process Builder for the delete action.

B. Unify all three triggers in a single trigger on the Expense__c object that includes all events.

C. Create helper classes to execute the appropriate logic when a record is saved.

D. Maintain all three triggers on the Expense__c object, but move the Apex logic out for the trigger definition.

A

B. Unify all three triggers in a single trigger on the Expense__c object that includes all events.

C. Create helper classes to execute the appropriate logic when a record is saved.

131
Q

Universal Containers wants a list button to display a Visualforce page that allows users to edit multiple records.
Which Visualforce feature supports this requirement?
A. tag
B. recordSetVar page attribute
C. custom controller
D. controller extension

A

B. recordSetVar page attribute

132
Q

Universal Containers recently transitioned from Classic to Lighting Experience. One of its business processes requires certain value from the opportunity object to be sent via HTTP REST callout to its external order management system based on a user-initiated action on the opportunity page. Example values are as follow
* Name
* Amount
* Account
Which two methods should the developer implement to fulfill the business requirement? (Choose 2 answers)
A. Create an after update trigger on the Opportunity object that calls a helper method using
@Future(Callout=true) to perform the HTTP REST callout.

B. Create a Lightning component that performs the HTTP REST callout, and use a Lightning Action to expose the component on the Opportunity detail page.

C. Create a Process Builder on the Opportunity object that executes an Apex immediate action to perform the HTTP REST callout whenever the Opportunity is updated.

D. Create a Visualforce page that performs the HTTP REST callout, and use a Visualforce quick action to expose the component on the Opportunity detail page.

A

D. Create a Visualforce page that performs the HTTP REST callout, and use a Visualforce quick action to expose the component on the Opportunity detail page.

B. Create a Lightning component that performs the HTTP REST callout, and use a Lightning Action to expose the component on the Opportunity detail page.

133
Q
A developer must create a ShippingCalculator class that cannot be instantiated and must include a working default implementation of a calculate method, that sub-classes can override. What is the correct implementation of the ShippingCalculator class?
A. Public abstract class ShippingCalculator {
public override calculate() { /*implementation*/ }
}
B. Public abstract class ShippingCalculator {
public virtual void calculate() { /*implementation*/ }
}
C. Public abstract class ShippingCalculator {
public abstract calculate() { /*implementation*/ }
}
D. Public abstract class ShippingCalculator {
public void calculate() { /*implementation*/ }
}
A
B. Public abstract class ShippingCalculator {
public virtual void calculate() { /*implementation*/ }
}
134
Q
As a part of class implementation a developer must execute a SOQL query against a large data ser based on the contact object. The method implementation is as follows.
https://www.freecram.net/question/Salesforce.PDI.v2021-10-29.q72/as-a-part-of-class-implementation-a-developer-must-execute-a-soql-query-against-a-large-data-ser-based#

Which two methods are best practice to implement heap size control for the above code? (Choose 2 Answers)
A. Use the FOR UPDATE option on the SOQL query to lock down the records retrieved.

B. Use a SOQL FOR loop, to chunk the result set in batches of 200 records.

C. Use WHERE clauses on the SOQL query to reduce the number of records retrieved.

D. Use visual keyword when declaring the retrieve variable.

A

B. Use a SOQL FOR loop, to chunk the result set in batches of 200 records.
D. Use visual keyword when declaring the retrieve variable.

135
Q

What are three capabilities of the tag when loading JavaScript resources in Aura components?

Choose 3 answers
ALoading files from Documents
BOne-time loading for duplicate scripts
CSpecifying loading order
DLoading scripts In parallel
ELoading externally hosted scripts
A

BOne-time loading for duplicate scripts
CSpecifying loading order
DLoading scripts In parallel

136
Q

A development team wants to use a deployment script lo automatically deploy lo a sandbox during their development cycles.
Which two tools can they use to run a script that deploys to a sandbox?
Choose 2 answers
A. SFDX CLI

B. Developer Console

C. Change Sets

D. Ant Migration Tool

A

A. SFDX CLI

D. Ant Migration Tool

137
Q

When a user edits the Postal Code on an Account, a custom Account text field named ‘‘Timezone’’ must be updated based on the values in a postalCodeToTimezone_c custom object.
What should be built to implement this feature?
A. Account assignment rule

B. Account workflow rule

C. Account approval process

D. Account custom trigger

A

D. Account custom trigger

138
Q

Which two characteristics are true for Aura component events? Choose 2 answers
A. If a container component needs to handle a component event, add a includeFacets” true” attribute to its handler.

B. Depending on the current propagation phase, calling event. Stoppropagation () may not stop the event propagation.

C. The event propagates to every owner in the containment hierarchy.

D. By default, containers can handle events thrown by components they contain.

A

B. Depending on the current propagation phase, calling event. Stoppropagation () may not stop the event propagation.

C. The event propagates to every owner in the containment hierarchy.

139
Q
A developer must create a DrawList class that provides capabilities defined in the Sortable and Drawable interfaces. public interface Sortable { void sort(); } public interface Drawable { void draw(); } Which is the correct implementation?
A. Public class DrawList implements Sortable, Implements Drawable {
public void sort() { /*implementation*/}
public void draw() { /*implementation*/}
]
B. Public class DrawList extends Sortable, Drawable {
public void sort() { /*implementation*/}
public void draw() { /*implementation*/}
}

C. Public class DrawList extends Sortable, extends Sortable, extends Drawable { public void sort() { /implementation/ } public void draw() { /* implementation */}

D. Public class DrawList implements Sortable, Drawable {
public void sort() { /*implementation*/}
public void draw() { /*implementation*/}
}
A
D. Public class DrawList implements Sortable, Drawable {
public void sort() { /*implementation*/}
public void draw() { /*implementation*/}
}
140
Q

?A developer needs to create a custom button for the Account object that, when clicked, will perform a series of calculation and redirect the user to a custom visualforce page.
Which three attributes need to be defined with values in the tag to accomplish this?
Choose 3 answers
A. extensions

B. Action

C. readOnly

D. standard Controller

E. renderAs

A

A. extensions

B. Action
D. standard Controller

141
Q

Which two statements are accurate regarding Apex classes and interfaces?
Choose 2 answers
A. Interface methods are public by default.

B. A top-level class can only have one inner class level.

C. Inner classes are public by default.

D. Classes are final by default.

A

A. Interface methods are public by default.

B. A top-level class can only have one inner class level.

142
Q

A developer must build an application that tracks which Accounts have purchased specific pieces of equipment that are represented as Products. Each Account could purchase many pieces of equipment.
How should the developer track that an Account has purchased a piece of equipment?

A. Use the Asset object
B. Use a Master-Detail on Product to Account
C. Use a Custom object
D. Use a Lookup on Account to Product

A

A. Use the Asset object

143
Q
A developer creates a new Apex trigger with a helper class, and writes a test class that only exercises 95% coverage of the new Apex helper class.
Change Set deployment to production fails with the test coverage warning:
"Test coverage of selected Apex Trigger is 0%, at least 1% test coverage is required."
What should the developer do to successfully deploy the new Apex trigger and helper class?
A. Increase the test class coverage on the helper class.
B. Remove the failing test methods from the test class.
C. Run the tests using the 'Run All Tests' method.
D. Create a test class and methods to cover the Apex trigger.
A

D. Create a test class and methods to cover the Apex trigger.

144
Q

A team of developers is working on a source-driven project that allows them to work independently, with many different org configurations.
Which type of Salesforce orgs should they use for their development?

A. Developer orgs
B. Developer sandboxes
C. Full Copy sandboxes
D. Scratch orgs

A

D. Scratch orgs

145
Q

A developer has a requirement to create an Order when an Opportunity reaches a ‘Closed-Won’ status.
Which tool should be used to implement this requirement?

A. Lightning Component
B. Apex Trigger
C. Lightning Flow
D. Process Builder

A

D. Process Builder

146
Q

A developer has a Apex controller for a Visualforce page that takes an ID as a URL parameter. How should the developer prevent a cross site scripting vulnerability?
A. String.ValueOf(ApexPages.currentPage() .getParameters() .get(‘url_param’))

B. String.escapeSingleQuotes(ApexPages.currentPage() .getParameters(). get(‘url_param’))

C. ApexPages.currentPage() .getParameters() .get(‘url_param’)

D. ApexPages.currentPage() .getParameters() .get(‘url_param’) .escapeHtml4()

A

D. ApexPages.currentPage() .getParameters() .get(‘url_param’) .escapeHtml4()

147
Q
How should a developer write unit tests for a private method in an Apex class?
A. Mark the Apex class as global.

B. Use the SeeAllData annotation.

C. Use the TestVisible annotation.

D. Add a test method in the Apex class.

A

C. Use the TestVisible annotation.

148
Q

A developer has the following requirements:
Calculate the total amount on an Order.
Calculate the line amount for each Line Item based on quantity selected and price.
Move Line Items to a different Order if a Line Item is not stock.
Which relationship implementation supports these requirements?
A. Order has a Master-Detail field to Line Item and there can be many Line Items per Order.

B. Line Items has a Master-Detail field to Order and the Master can be re-parented.

C. Order has a Lookup field to Line Item and there can be many Line Items per Order.

D. Line Item has a Lookup field to Order and there can be many Line Items per Order

A

B. Line Items has a Master-Detail field to Order and the Master can be re-parented.

149
Q

Which process automation should be used to send an outbound message without using Apex code?
A. Flow Builder

B. Workflow Rule

C. Approval Process

D. Process Builder

A

B. Workflow Rule

150
Q

A developer created a custom order management app that uses an Apex class.
The order is represented by an PurchaseOrder Object and an PurchaseOrderltem Object that has a master-detail relationship to Order. During order processing, an order may be split into multiple orders.

What should a developer do to allow their code to move some existing PurchaseOrderltem records to a new PurchaseOrder record?

Add without sharing to the Apex class declaration

Change the master-detail relationship to an external lookup relationship

Create a junction object between PurchaseOrderltem and PurchaseOrder

Select the Allow reparenting option on the master-detail relationship

A

Select the Allow reparenting option on the master-detail relationship

151
Q

What will be the result of the below code

      Account myAccount = new Account();
        Database.insert(myAccount, false);

The record will not be created and an exception will be thrown
The record will be created and a message will be in the debug log
The will be created and no error will be reported
The record will not be created and no error will be reported

A

The record will not be created and no error will be reported

152
Q

What should a developer do to check the code coverage of a class after running all tests?

Select and run the class on the Apex Test Execution page in the Developer Console

View the Class Test Percentage tab on the Apex Class list view in Salesforce Setup

View the code coverage percentage for the class using the Overall Code Coverage panel in the Developer Console Tests tab

View the Code Coverage column in the list view on the Apex Classes page

A

View the code coverage percentage for the class using the Overall Code Coverage panel in the Developer Console Tests tab

153
Q

What will be the output of the following block of code?

For(Account thisAccount : [Select Id, Industry FROM Account Limit 150])
{
If(thisAccount.Industry == ‘Techonogy’){
thisAccount.AccountNumber = ‘122345’;
}
Update thisAccount;
}

If executed in an async context the apex transaction is likely to fail by exceeding governor limit

If executed in an synchronous context the apex transaction is likely to fail by exceeding governor limit

Apex transaction fails with the error message “SObject row was retrieved via SOQL without querying the requested field - Account.AccountNumber”

The APEX transaction succeeds regardless of any uncaught exception and all processed accounts are updated

A

The APEX transaction succeeds regardless of any uncaught exception and all processed accounts are updated

154
Q

The Salesforce Administrator created a custom picklist field, Account_status__c, on the Account object. This
picklist has possible values Of “Inactive- and “Active”.
As part of a new business process, management wants to ensure an opportunity record is created only for
Accounts marked as “Active”. A developer is asked to Implement this business requirement.

Which two automation tools should be used to fulfill the business need?

Choose 2 answers

Approval process

Salesforce Flow

Process Builder

Salesforce Flow

A

Process Builder

Salesforce Flow

155
Q

Which action causes a before trigger to fire by default for Accounts?

Renaming or replacing a picklist

Converting Leads to Person accounts or Contact accounts

Importing data using data loader and bulk API

Updating address using Mass address update tool

A

Converting Leads to Person accounts or Contact accounts

156
Q

How should a custom user interface be provided when a user edits an Account in Lightning Experience?

Override the Account’s Edit button with Lightning page

Override the Account’s Edit button with Lightning Flow

. Override the Account’s Edit button with Lightning Action

Override the Account’s Edit button with a Lightning component

A

Override the Account’s Edit button with a Lightning component

157
Q

For which three items can a trace flag be configured? Choose 3 options

Flow
User
Apex Trigger
Apex Class

A

User
Apex Trigger
Apex Class

158
Q

Which three Salesforce resources can be accessed from a Lightning web component? Choose 3 options

Content asset files

SVG resources

Static resources

3rd party web component

A

Content asset files

SVG resources

Static resources

159
Q

An Approval Process is defined in the Expense_Item__c.
A business rule dictates that whenever a user changes the Status to ‘Submitted’ on an Expense_Report__c record, all the Expense_Item__c records related to the expense report must enter the approval process individually.
Which approach should be used to ensure the business requirement is met?
Create a Process Builder on Expense_Report__c with a ‘Submit for Approval’ action type to submit all related Expense_Item__c records when the criteria is met
Create a Process Builder on Expense_Report__c with an ‘Apex’ action type to submit all related Expense_Item__c records when the criteria is met.
Create a Process Builder on Expense_Report__c to mark the related Expense_Item__c as submittable and trigger on Expense_item__c to submit the records for approval.
Create two Process Builder, one on Expense_Report__c to mark the related Expense_Item__c as submittable and the second on Expense_Item__c to submit the records for approval.

A

Create two Process Builder, one on Expense_Report__c to mark the related Expense_Item__c as submittable and the second on Expense_Item__c to submit the records for approval.

160
Q

A team of many developers work in their own individual orgs that have the same configuration at the production org. Which type of org is best suited for this scenario?

Full Sandbox

Developer Sandbox

Developer Edition

Partner Developer Edition

A

Developer Sandbox

161
Q

When a user edits the Postal Code on an Account, a custom Account text field named “Timezone” must be update based on the values in a PostalCodeToTimezone__c custom object. How should a developer implement this feature?

A. Build an Account Assignment Rule.

B. Build an flow with Flow builder.

C. Build an account Approval Process

D. Build an Account Workflow Rule

A

B. Build an flow with Flow builder.

162
Q

What are three categories of change set deployments ?

A. Change sets can be used only between related organizations

B. Change sets can be used to transfer records

C. Change sets can deploy custom settings data

D. Deployment is done in a one-way, single transaction

E. Sending a change set between two ords require a deployment connection

A

C. Change sets can deploy custom settings data

D. Deployment is done in a one-way, single transaction

E. Sending a change set between two ords require a deployment connection

163
Q

Which scenario is valid for execution by unit tests?

Load data from a remote site with a callout.

Set the created date of a record using a system method.

Execute anonymous Apex as a different user.

Generate a Visualforce PDF with geccontentAsPDF ()

A

Set the created date of a record using a system method.

164
Q

When importing and exporting data into Salesforce, which two statements are true? Choose 2 answers

A . Bulk API can be used to import large data volumes in development environments without bypassing the storage limits.

B . Bulk API can be used to bypass the storage limits when importing large data volumes in development environments.

C . Developer and Developer Pro sandboxes have different storage limits.

D . Data import wizard is a client application provided by Salesforce.

A

A . Bulk API can be used to import large data volumes in development environments without bypassing the storage limits.

C . Developer and Developer Pro sandboxes have different storage limits.

165
Q

What are two ways a developer can get the status of an enqueued job for a class that queueable interface? Choose 2 answers

A. View the apex flex Queue

B. View the apex status Page

C. Query the AsyncApexJobe object

D. View the apex Jobs page

A

C. Query the AsyncApexJobe object

D. View the apex Jobs page

166
Q

Which three statements are true regarding custom exceptions in Apex?

A. A custom exception class must extend the system Exception class
B. A custom exception class can implement one or many interfaces
C. A custom exception class cannot contain member variables or methods
D. A custom exception class name must end with "Exception"
E. A custom exception class can extend other classes besides the Exception clas
A
A. A custom exception class must extend the system Exception class
B. A custom exception class can implement one or many interfaces
D. A custom exception class name must end with "Exception"
167
Q

?Which three statements are accurate about debug logs? Choose 3 answers

A.
Amount of information logged in the debug log can be controlled programmatically.

B.
Debug Log levels are cumulative, where FINE lop level includes all events logged at the DEBUG, INFO, WARN, and ERROR levels.

C.
Amount of information logged in the debug log can be controlled by the log levels.

D.
To View Debug Logs, “Manager Users” or “View All Data” permission is needed.

E.
To View Debug Logs, “Manager Users” or “Modify All Data” permission is needed.

A

A.
Amount of information logged in the debug log can be controlled programmatically.

B.
Debug Log levels are cumulative, where FINE lop level includes all events logged at the DEBUG, INFO, WARN, and ERROR levels.

C.
Amount of information logged in the debug log can be controlled by the log levels.

168
Q

Which two statements are true about using the @testSetup annotation in an Apex test class?

Choose 2 answers

A.
Records created in the test setup method cannot be updated in individual test methods.

B.
Qo The @testSetup annotation is not supported when the GisTest(SeeAllData=True) annotation is used.

C.
Test data is inserted once for all test methods in a class.

D.
A method defined with the @testSetup annotation executes once for each test method in the test class and counts towards system limits.
A

B.
Qo The @testSetup annotation is not supported when the GisTest(SeeAllData=True) annotation is used.
D.
A method defined with the @testSetup annotation executes once for each test method in the test class and counts towards system limits.

169
Q

Which action may cause triggers to fire?

A.
Updates to Feed Items

B.
Renaming or replacing a picklist entry

C.
Changing a user’s default division when the transfer division option is checked

D.
Cascading delete operations

A

A.

Updates to Feed Items

170
Q

A developer receives an error when trying to call a global server-side method using the ©remoteAction decorator.

How can the developer resolve the error?

A.
Change the function signature to be private static.

B.
Add static to the server-side method signature.

C.
A Decorate the server-side method with (static=true).

D.
Decorate the server-side method with (static=false).

A

B.

Add static to the server-side method signature.

171
Q

Given the following code snippet, that is part of a custom controller for a Visualforce page:

In which two ways can the try/catch be enclosed to enforce object and field-level permissions and prevent the DML statement from being executed if the current logged-in user does not have the appropriate level of access? Choose 2 answers

Options:

A.
Use if (Schema, sobjectType, Contact, isUpdatable ( ) )
B.
Use if (Schema , sobjectType. Contact. Field, Is_Active_c. is Updateable ( ) )
C.
Use if (Schema.sObjectType.Contact.isAccessible ( ) )
D.
Use if (thisContact.Owner = = UserInfo.getuserId ( ) )

Show Answer

A
A.
Use if (Schema, sobjectType, Contact, isUpdatable ( ) )
B.
Use if (Schema , sobjectType. Contact. Field, Is_Active_c. is Updateable ( ) )
172
Q

An org has an existing Visual Flow that creates an Opportunity with an Update records element. A developer must update the Visual Flow also created a Contact and store the created Contact’s ID on the Opportunity.

Options:

A.
Add a new Get Records element.

B.
Add a new Create records element.

C.
Add a new Quick Action (of type create) element.

D.
Add a new Update records element

Show Answer

A

B.

Add a new Create records element.

173
Q

A developer has to identify a method in en Apex class that performs resource intensive actions in memory by iterating over the result set of a SOQL statement on the account. The method also performs a SOQL statement to save the changes to the database.

Which two techniques should the developer implement as a best practice to ensure transaction control and avoid exceeding governor limits?

Choose 2 answers

Options:

A.
Use the @ReadOnly annotation to bypass the number of rows returned by a SOQL.

B.
Use Partial DHL statements to ensure only valid data is committed.

C.
Use the Database.Savepoint method to enforce database integrity.

D.
Use the System.Limit class to monitor the current CPU governor limit consumption.
A

C.
Use the Database.Savepoint method to enforce database integrity.

D.
Use the System.Limit class to monitor the current CPU governor limit consumption.
174
Q

A developer must modify the following code snippet to prevent the number of SOQL queries issued from exceeding the platform governor limit. public class without sharing OpportunityService( public static List getOpportunityProducts(Set opportunityIds){ List oppLineItems = new List(); for(Id thisOppId : opportunityIds){ oppLineItems.addAll([Select Id FROM OpportunityLineItems WHERE OpportunityId = :thisOppId)]; } return oppLineItems; } }

The above method might be called during a trigger execution via a Lightning component. Which technique should be implemented to avoid reaching the governor limit?

Options:

A.
Use the System.Limits.getQueries() method to ensure the number of queries is less than 100.

B.
Use the System.Limits.getlimitQueries() method to ensure the number of queries is less than 100.

C.
Refector the code above to perform the SOQL query only if the Set of opportunityIds contains less 100 Ids.

D.
Refactor the code above to perform only one SOQL query, filtering by the Set of opportunityIds.

A

D.

Refactor the code above to perform only one SOQL query, filtering by the Set of opportunityIds.

175
Q

A developer wants to retrieve the Contacts and Users with the email address ‘dev@uc.com’.

Which SOSL statement should the developer use?

Options:

A.
FIND {dev@uc.com} IN Email Fields RETURNING Contact (Email), User (Email)

B.
FIND {Email = ‘dev@uc.com’} IN Contact, User

C.
FIND {Email = ‘dev@uc.com’} RETURNING Contact (Email), User (Email)

D.
FIND Email IN Contact, User FOR {dev2uc.com}

Show Answer

A

A.

FIND {dev@uc.com} IN Email Fields RETURNING Contact (Email), User (Email)

176
Q

A develop created these three roll-up summary fields on the custom object. Project_c:

The developer is asked to create a new field that should the ratio between rejected and approved timesheet for a given project.

What are two benefits of choosing a formula held instead of an Apex trigger to fulfill the request? Choose 2 answers

Options:

A.
A test class will validate the formula field during deployment.

B.
A formula field will trigger existing automation when deployed.

C.
A formula field will calculate the retroactively for existing records

D.
Using a formula field reduces maintenance overhead.

Show Answer

A

B.
A formula field will trigger existing automation when deployed.

C.
A formula field will calculate the retroactively for existing records

177
Q

?What should a developer do to check the code coverage of a class after running all tests?
A . View the Code Coverage column in the view on the Apex Classes page.
B . View the Class test Coverage tab on the Apex Class record.
C . view the overall Code Coverage panel of the tab in the Developer Console.
D . Select and run the class on the Apex Test Execution page

A

C . view the overall Code Coverage panel of the tab in the Developer Console.

178
Q

Einstein Next Best Action Is configured at Universal Containers to display recommendations to internal users on the Account detail page.

If the recommendation is approved, a new opportunity record and task should be generated. If the recommendation is rejected, an Apex method must be executed to perform a callout to an external system.

Which three factors should a developer keep Hi mind when implementing the Apex method?

Choose 3 answers

Options:

A.
The method must use the @AuraEnabled annotation.

B.
The method must use the @Future annotation.

C.
The method must use the @invocableMethod annotation.

D.
The method must be defined as static.

E.
The method must be defined as public.

Show Answer

A

B.
The method must use the @Future annotation.
D.
The method must be defined as static.

E.
The method must be defined as public.