PD1: Practice Exam 1

A developer requires a variable numberOfStudents with a constant value of 25 that is accessible only within the Apex class in which it is defined.  Which of the following is the best variable declaration? Choose 1 answer.

A) protected final Integer numberOfStudents = 25;

B) private static final Integer numberOfStudents = 25;

C) global static Integer numberOfStudents = 25;

D) public Integer numberOfStudents = 25;

Answer: B

Cosmic Solutions would like to generate invoices in Salesforce, allow customers to pay their invoice securely from their email, and process the payment.  Which of the following should be used to meet this requirement?

A) Lightning Process Builder

B) AppExchange app

C) Workflow Rule and Formula Fields

D) Custom Apex Solution

Answer: B

A developer is trying to create a trigger that will set the record type of an Invoice record, prior to insertion, based on the value of the Industry picklist that is selected.  What trigger event should the developer use? Choose 1 answer.

A) Before Delete

B) After Update

C) Before Insert

D) After Insert

Answer: C

Which of the following field types can a Roll-Up Summary field calculate? Choose 1 answer.

A) Picklist

B) Checkbox

C) Text

D) Number

Answer: Number

A developer needs to create a new Contact record in his Apex Trigger.  What DML statement should be used in the code? Choose 1 answer

A) Create

B) Insert

C) Upsert

D. Merge

Answer: B

What considerations for deciding between using Data Loader and the Data Import Wizard for loading data into a development environment? Choose 3 answers

A) The number of records to be loaded

B) If triggers should run on import of the data

C) If the data will need to be loaded multiple times

D) If the object is supported by the Data Import Wizard

Answers: A, C and D

Which of the following are capabilities of the schema builder? Choose 3 answers

A) Create a custom object

B) Export the schema definition

C) Delete a custom object

D) Create Lookup and master-detail relationships

Answers: A, C and D

Which of the following statements about the IF-ELSE statements are true? Choose 2 answers

A) The IF-ELSE statement permits a choice to be made between two possible execution paths

B) An IF-ELSE statement can have a number of possible execution paths

C) The IF-ELSE statement provides a secondary path of execution when an IF clause evaluates to true

D) An IF statement can be followed by a discretionary ELSE statement, which executes when the Boolean expression is false

Answers: A and D

Which of the following best describe the Lightning Component Framework? Choose 2 answers

A) It automatically upgrades all pre-existing Visualforce pages and components

B) It has an event-driven architecture

C) It is device-aware and supports cross-browser compatibility

D) It uses ODS as its data format

Answers: B and C

A developer is required to create a trigger that every time the Type field on the Request object is updated, the Owner field should be changes as well, either to a User or Queue.  What trigger event should the developer use? Choose 1 answer.

A) After Update

B) Before Delete

C) After Merge

D) Before Update

Answer:  D

Which of the following is required when defining an Apex Class Method? Choose 1 answer

A) Access Modifiers

B) Input Parameters

C) Definition Modifiers

D) Return Type

Answer: D

A component bundle contains a component or an app and all its related resources.  Which of the following resources are part of the standard component bundle? Choose 4 answers

A) Documentation

B) Image and Animations

C) Helper

D) Rerenderer

E) CSS Styles

Answers: A, C, D and E

Which of the following statements are true about creating unit tests in Apex? Choose 2 answers

A) Lines of code in test methods and test classes are not counted as part of calculating Apex code coverage

B) Since data created in tests do not commit, you will not need to delete any data

C) If code uses conditional logic (including ternary operations), one scenario will automatically cover all conditions

D) Use the System.assert() method to test your application in different user contexts

Answers: A and B

Which of the following are capabilities of the Force.com IDE? Choose 3 answers

A) Deploying metadata components from one org to another

B) Creating Change Sets

C) Executing SOQL queries

D) Running Apex Tests

Answers: A, C and D

A developer would like to relate an external data object (Social Media Posts) to the contacts object in Salesforce to track every post the contact has made in the external platform.  How can the developer achieve this? Choose 1 answer

A) Create a lookup relationship and update the record ID through integration

B) Create an external lookup relationship using a custom field with External ID and Unique Attributes

C) Create an indirect lookup relationship using a custom field with External ID and Unique Attributes

D) Create a master-detail relationship and update the record ID through integration

Answer: C

Dynamic Computing would like to be able to manage sales and support tasks differently and display different fields for each.  How can this requirement be met? Choose 2 answers

A) Formula fields

B) Record Types

C) Page Layouts

D) Workflow rules

Answers: B and C

Which of the following statements about defining an Apex Class are true? Choose 3 answers

A) An access modifier is required in the declaration of a top-level class

B) A developer may add optional extensions and/or implementations

C) The keyword[class] is required if no access modifier is present

D) A definition modifier is required in the top-level class

E) The keyword [class] followed by the name of the class is necessary

Answers: A, B and E

A developer needs to access a list of data on a Visualforce page and represent the data as a table.  However, the developer would also like to customize the look and feel and not use the standard Salesforce styling.  What Visualforce components can the developer use? Choose 3 answers

A) <apex:dataTable>

B) <apex:repeat>

C) <apex:listTable>

D) <apex: table>

E) <apex:dataList>

Answers: A, B and E

Which standard objects in the following list are not supported by DML Operations? Choose 2 answers

A) Profile

B) User

C) Opportunity Line Item

D) Record Type

Answers: A and D

When test data cannot be created programmatically, how can pre-existing data be accessed? Choose 1 answer

A) Annotate the test method with [withSharing = true]

B) Annotate the test class or method with [seeAllData = true]

C) Annotate the test class or method with [seeAllData = true]

D) Annotate the test method with [withSharing = false]

Answer: B

How can SOQL injection be prevented? Choose 1 answer

A) Use the preventDatabaseCommands method

B) Use the preventQuotes method

C) Use the preventInjection method

D) Use the escapeSingleQuotes method

Answer: D

The Stage field of all related Opportunity records should be updated to [Close Lost], when the associated Account record becomes inactive.  What could be used for this? Choose 1 answer

A) Approval Process

B) Workflow Rule

C) Process Builder

D) Flow

Answer: C

 

 

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.