Salesforce PD1 Questions Flashcards

1
Q

How is Model-View-Controller (MVC) architecture implemented on the Salesforceplatform?

A

Model: Standard and Custom Objects; View: Visualforce Pages; Controller: ApexCode

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

What are two sets of code that represent the Controller in MVC architecture on the Force.com platform?

A
  1. Standard Controllersystem methods that are referenced by Visual force. 2. Custom Apex and JavaScript code that is used to manipulate data.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Name two users that can edit a record after it has been locked for approval?

A

1.An administrator 2. A user who is assigned as the current approver

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

Name three capabilities of cross-object formula fields?

A
  1. Formula fields can expose data the user does not have access to in a record. 2. Formula fields can reference fields from objects that are up to 10 relationships away. 3. Formula fields can reference fields from master-detail or lookup parent relationship.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

On a Visualforce page with a custom controller, how should a developer retrieve a record by using an ID parameter that is passed on the URL?

A

Use the constructor method for the controller)

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

Describe two situations when would a developer use a custom controller instead of a controller extension?

A
  1. When a Visualforce page needs to replace the functionality of a standard controller. 2. When a Visualforce page should not enforce permissions or field -level security.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

If a developer has a block of code that omits some statements from being shared but the organization-wide dafault is different, what will happen.

A

The Apex Controllers will automatically obey the organization-wide sharing defaults.

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

What is the result when a Visualforce page calls an Apex controller, which calls another Apex class, with the result “!Multiple in hitting a governor limit”?

A

Any changes up to the error are rolled back.

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

Which control statement should a developer use to implement set of code that executes for every record in the recordset, without performing a .size() or .length() method call when the number of records in recordset are unknown?

A

For (variable : list_or_set) {

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

Describe two best practices for a developer to follow when writing a trigger?

A
  1. Using the Map data structure to hold query results by ID. 2. Using the Set data structure to ensure distinct records.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

Describe two actions a developer can perform in a before update trigger.

A
  1. Change field values using the Trigger.new context variable. 2. Display a custom error message in the application interface
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

A developer creates a method in an Apex class and needs to ensure that errors are handled properly. What would the developer use?

A

A custom exception.addError() and A try/catch construct

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

In the code below, what type does Boolean inherit from?

Boolean b = true;

A

object

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

Which standard field needs to be populated when a developer inserts new contact records programmatically?

A

LastName

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

What are three capabilities of formula fields?

A
  1. Determine which of three different images to display using the IF function. 2. Generate the link using the HYPERLINK function using a specific record in a legacy system. 3. Determine if a datetime field has passed using the NOW function.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

Does a roll-up summary field work with a look-up relationship?

A

No, roll-up summary field only works with master-detail relationships.

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

Name three areas where custom rollup summary fields can be created using Standard Object relationships?

A
  1. On Campaign using Campaign member records. 2. On Account using Opportunity records. 3. On Opportunity using Opportunity Product records
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
18
Q

Your client hires a new intern. The intern is not allowed to view Opportunities, but needs to see the Most Recent Closed Date of all child Opportunities when viewing an Account record. What would a developer do to meet this requirement?

A

Create a rollup summary field on the Account object that performs a MAX on the Opportunity Close Date field.

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

On which object can an administrator create a rollup summary field?

A

Any object that is on the master side of a master-detail relationship

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

What would you use when a record has certain values?

A

Three of our tools can address this use case: Workflow, Process Builder, and Visual Workflow. Respectively, these tools create workflow rules, processes, and flows.

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

What would you use if you need to get information from customers and do something with it?

A

Visual Workflow is the tool for you. Create a flow that displays information to and requests information from a user.

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

Name three declarative methods that help ensure quality data?

A

Validation rules, Lookup filters, Page layouts

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

A developer wrote a workflow email alert on case creation so that an email is sent to the case owner manager when a case is created. When will the email be sent?

A

After committing to database

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

The Humane Society uses a custom object to track animals and would like to send adoption candidates information automatically to a third-party system when a adoption candidate is selected to adopt an animal. What can a developer do to accomplish this task?

A

Create a workflow rule with an outbound message action.

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

What would a developer do to update a picklist field on related Opportunity records when a modification to the associated Account record is detected?

A

Create a process with Process Builder

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

Your client requires that the Lead Source field of the Lead record be populated when a Lead is converted. What would a developer use to ensure that a user populates the Lead Source field prior to converting a Lead?

A

Validation Rule

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

A developer wants to list all of the Tasks for each Account on the Account detail page. When a Task is created for a Contact, what does the developer need to do to display the Task on the related Account record?

A

Nothing. The Task is automatically displayed on the Account page.

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

An interviewer is required to enter a reason in the comments field only when a candidate is recommended to be hired. Which action can a developer take to enforce this requirement?

A

Create a validation rule

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

What are two valid statements about Apex classes and interfaces?

A

The default modifier for a class is private, Exception classes must end with the word exception.

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

A developer writes a before insert trigger. How can the developer access the incoming records in the trigger body?

A

By accessing the Trigger.new context variable.

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

A developer needs to automatically populate the ReportsTo field in a Contact record based on the values of the related Account and Department fields in the Contact record.Which type of trigger would the developer create?

A

Before update ,Before insert

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

How can a developer avoid exceeding governor limits when using an Apex Trigger?

A
  1. By performing DML transactions on lists of Objects , 2. By using maps to hold data from query results
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
33
Q

Identify two requirements that need to be implemented by using standard workflow instead of Process Builder?

A

Send an outbound message without Apex code AND Create activities at multiple intervals

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

In a single record, a user selects multiple values from a multi-select picklist. How are the selected values represented in Apex?

A

As a String with each value separated by a semicolon.

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

What are three things you need to know about variable scope?

A
  1. A variable can be defined at any point in the block. 2. Parallel blocks can use the same variable name. 3. Sub-blocks cannot reuse the same variable name.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
36
Q

What type of primitive data does Apex automatically assign to a currency field?

A

Decimal

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

Name three data types or collection of data types that SOQL statements populate or evaluate to?

A
  1. An integer, 2. A list of sObjects 3. A single sObject)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
38
Q

Name two ways a developer can display all of the available record types for a case object

A
  1. Use Schema.PickListEntry returned 2. Use Schema.RecordTypeInfo returned
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
39
Q

How can a developer determine from the describeSObjectResult if the current user will be able to create a record on an object in Apex?

A

By using the isCreatable() method

40
Q

A developer creates an Apex helper class to handle complex trigger logic. How can the helper class warn users when the trigger exceeds DML governor limits?

A

By using Limits.getDMLRows() and then displaying an error message before the number of DML statements exceeded.

41
Q

What is valid in the where clause of a SOQL query?

A

A geolocation field. or an alias notation.

42
Q

Which data structure is returned to a developer when performing a SOSL search?

A

A list of list of sObjects

43
Q

A developer has a block of code that omits any statements that indicate whether the code block should execute with or without sharing. What will automatically obey the organization-wide defaults and sharing settings for the user who executes the code in the salesforce Organization?

A

Apex Controllers

44
Q

This debug statement: ApexPages.StandardSetController controller = new ApexPages.StandardSetControllerDatabase.getQueryLocator(‘select Id from Account Limit 1’); will return what to the developer?

A

The ListView of an Account object

45
Q

A developer for a large wine company needs to create a Visualforce page that will override standard Account edit button, the page will be used to validate the account’s address using a SOQL query to make sure that the shipping address is correct. The page will also allow the user to make edits to the address. Where would the developer write the Account address verification logic?

A

In a controller extension.

46
Q

Puppies R’ Us is creating test data for products and pricebooks. What statement would the developer use?

A

ID pricebookID = Test.getStandardPricebookID();

47
Q

A developer writes a SOQL query to find child records for a specific parent. How many specific levels can be returned in a single query?

A

1

48
Q

What are the specific Governor limits of the number of records you can retrieve, update, and execute.

A

in a single transaction you can retrieve 50k records via SOQL, update 10k records, execute 100 SOQL calls, and execute 150 DML statements.

49
Q

What is a correct pattern to follow when programming in Apex on a multi-tenant platform?

A

Queries select the fewest fields and records possible to avoid exceeding governor limits

50
Q

When the value of a field in an account record is updated, which two methods will update the value of custom field related opportunities?

A
  1. An Apex trigger on the Account object. 2. A Process Builder on the Account object.
51
Q

Name two ways to avoid exceeding governor limits when using an Apex Trigger.

A

By performing DML transactions on lists of Objects, By using Maps to hold data from query results

52
Q

A developer for the Humane Society’s Salesforce creates a Workflow Rule declaratively that updates a field on the Adoption object. An Apex update trigger exists for the Adoption object as well. What happens when a user updates a record?

A

The Apex Trigger is fired more than once

53
Q

In which order does Salesforce execute events upon saving a record?

A

Before Triggers; Validation Rules; After Triggers; Assignment Rules; Workflow Rules; Commit

54
Q

What are the 4 main Salesforce APIs?

A
  1. REST API 2. SOAP API 3. Bulk API 4.Streaming API
55
Q

Which two components are available to deploy using the Metadata API?

A

Case Layout, Account Layout

56
Q

What are two ways a developer can provide a Visualforce page that lets users enter Product specific details during the Sales cycle?

A
  1. Create a new Visualforce page and an Apex controller to provide Product data entry. 2. Download an Unmanaged Package from the AppExchange that provides a custom Visualforce page to modify.
57
Q

What are the types of web content that can be incorporated into Visualforce pages

A

Maps, Charts, flows, PDF renderer and custom content type.

58
Q

What are two valid ways of loading external Javascript files into a VisualForce page?

A

A: 1. Apex:includeScript 2. Script

59
Q

What is the preferred way to reference web content - such as images, stylesheets, JavaScript, and other libraries, that is used in Visualforce pages?

A

By uploading the content as a Static Resource

60
Q

What are two ways a developer use a custom Visualforce page in a Force.com application?

A
  1. To create components for dashboards and layouts. 2. To generate a PDF document with application data.
61
Q

What are two characteristics of the Lightning Component framework?

A
  1. It Includes responsive components 2. It has event-driven architecture
62
Q

Which resources can be used to fire events in the Lightning Component Framework?

A
  1. Third party web service code 2. Javascript controller actions
63
Q

Where is client-side controller logic contained in the Lightning Component framework?

A

Javascript

64
Q

What are two resources that can be included in a Lightning Component bundle?

A
  1. Javascript 2. Documentation
65
Q

A Visualforce page has a standard controller for an object that has a lookup relationship to parent object. How can a developer display data from the parent record on the page?

A

By using merge field syntax to retrieve data from the parent record

66
Q

Name two capabilities of a StandardSetController?

A
  1. It allows pages to perform mass updates of records. 2. It allows pages to perform pagination with large record sets.
67
Q

Candidates can apply to adopt a puppy by submitting a single application per pet posting. Once it has been submitted, that application cannot be modified to be submitted to a different pet posting. How can you associate an application with each pet posting in the schema for the organization?

A

Create a master-detail relationship in the Application Custom object to the Pet Postings custom object

68
Q

A company has a custom object named Reservation. Each Reservation record has a distinct record owner, and is related to a parent Account in Salesforce. Which kind of relationship would a developer use to relate the Account to Reservation?

A

Lookup

69
Q

A developer is creating an application to track cameras and their parts. An individual part can be used on different types of cameras. What data model should be used to track the data and to prevent orphan records?

A

Create a junction object to relate many cameras to many parts through a master-detail relationship

70
Q

A Developer wants to create a custom object to track Shipments. How should Shipments and Accounts be related to ensure that all Shipments are visible to everyone with access to the Account?

A

The Invoice should have a Master -Detail relationship to the Account.

71
Q

What kind of relationship between a Standard and a Custom Object can prevent the deletion of a Standard Object?

A

Lookup Relationship.

72
Q

The Humane Society wants an adoption app that models animals and adoption applications; displays the total number of adoption applications each animal records; and defines security on adoption application records that is independent from the security on animal records. What would a developer do to accomplish this task?

A
  1. Create a lookup relationship between the Animal and Adoption Application objects 2. Create a trigger on the Adoption Application object that updates a field on the Animal object.
73
Q

In a Data management Scenario Question like display child related list on parent record, what is one thing that would need to be done?

A

have to manage permissions separately from parent etc.

74
Q

What would need to be used to visualize and create entity relationships in data modeling?

A

Schema Builder

75
Q

A developer wants to delete a custom field from the Account object that was required for prototyping, but is no longer needed. How can they achieve this using Schema Builder?

A

Remove all references from the code and then delete the custom field from Schema Builder

76
Q

What are two ways a developer can match records to update existing records when loading data into an organization?

A
  1. Match an external Id Text field to a column in the imported file 2. Match the Id field to a column in the imported file
77
Q

Give 3 use cases that would require a partial copy or full sandbox.

A
  1. Scalability Testing 2. Batch Data Testing 3.Integration Testing
78
Q

A developer is creating a sandbox, they have 3GB of data and need to be able to refresh the sandbox frequently. Should they use a partial or a full sandbox?

A

Partial Copy Sandbox

79
Q

What is the proper process for an Apex Unit Test?

A

Create data for testing. Call the method being tested. Verify that the results are correct.

80
Q

A developer creates a new Visualforce page and Apex extension, and writes test classes that exercise 95% coverage of the new Apex extension. Change set deployment to production fails with the test coverage warning: ‘Average test coverage across all Apex classes and triggers is 64%; at least 75% test coverage is required.’ What can the developer do to successfully deploy the new Visualforce page and extension?A developer creates a new Visualforce page and Apex extension, and writes test classes that exercise 95% coverage of the new Apex extension. Change set deployment to production fails with the test coverage warning: ‘Average test coverage across all Apex classes and triggers is 64%; at least 75% test coverage is required.’ What can the developer do to successfully deploy the new Visualforce page and extension?

A

Add test methods to existing test classes from previous deployments.

81
Q

What happens when you are testing and use the Test.startTest() and Test.stopTest() method pair during the execution of a single test class?

A

You get a fresh set of governor limits.

82
Q

When creating unit tests in Apex, what contributes important feedback but does not increase code coverage?

A

System Assert Statements

83
Q

A developer creates a new Visualforce page and Apex extension, and writes test classes that exercise 95% coverage of the new Apex extension. Change set deployment to production fails with the test coverage warning: ‘Average test coverage across all Apex classes and triggers is 64%; at least 75% test coverage is required.’ What can the developer do to successfully deploy the new Visualforce page and extension?

A

Loading test data in place of user input for Flows.

84
Q

An org has different Apex classes that provide Account-related functionality. After a new validation rule is added to the Account object, many of the test methods fail. Describe two ways to resolve the failures and reduce the number of code changes?

A
  1. Create a method that creates valid Account records, and call this method from within test methods and 2. Create a method that loads valid Account records from a Static Resource, and call this method within test methods
85
Q

A developer creates an Apex class that includes private methods. What can the developer do to ensure that the private methods can be accessed by the test class?

A

Add the TestVisible attribute to the Apex methods.

86
Q

Describe the differences between invoking Apex in execute anonymous vs. unit test

A

Unit test executes in system mode and any changes made to records are not visible out of its test execution context where with anonymous block any changes performed to data are visible after its execution is successful. Code written in anonymous block is not stored as metadata in Salesforce org and user permissions are enforced during execution.

87
Q

Which two tools should a developer working in a sandbox use to exercise a new test class before the developer deploys that test class to production?

A

The Apex Test Execution page in Salesforce Setup AND The Test menu in the Developer Console

88
Q

Which two features help a developer know if all tests currently pass in salesforce environment?

A

Developer console, Salesforce UI Apex Test Execution

89
Q

At what log level are User Debugs logged?

A

DEBUG or higher.

90
Q

Choose two places where can debug log filter settings be set?

A
  1. The filters link by the monitored user’s name within the web UI and 2. The log filters tab on a class or trigger detail page.
91
Q

Identify two types of information provided by the Checkpoints tab in the Developer console.

A

Namespace, Time

92
Q

Describe three capabilities of the Developer Console

A
  1. Execute Anonymous Apex Code, 2. Create/Edit Code, 3. View Debug Logs
93
Q

A developer created an Apex trigger using the Developer Console and now wants to debug code. How can the developer accomplish this in the Developer Console?

A

Open the Logs tab in the Developer Console

94
Q

What are two capabalities of Force.com IDE?

A
  1. Edit metadata components. 2. Run Apex tests.
95
Q

Which two Deployment Tools can be used to move metadata?

A
  1. Change Sets 2 Force.com Migration tool
96
Q

Identify two different options that a valid source and destination pair can use to send or receive change sets.

A
  1. Sandbox to production, 2. Sandbox to sandbox.
97
Q

Describe three facts about change set deployments.

A
  1. They can be used only between related organizations, 2. They require a deployment connection, 3. They use an all or none deployment model.