Salesforce PD1

Description

Quiz on Salesforce PD1, created by Andrew Seeley on 18/04/2017.
Andrew Seeley
Quiz by Andrew Seeley, updated more than 1 year ago
Andrew Seeley
Created by Andrew Seeley about 7 years ago
1070
3

Resource summary

Question 1

Question
What is a capability of the Developer Console?
Answer
  • Execute Anonymous Apex Code, Run REST API, Create/EDIT Code
  • Execute Anonymous Apex Code, Create/Edit Code, View Debug Logs
  • Execute Anonymous Apex Code, Run REST API, Deploy code changes
  • Execute Anonymous Apex Code, Create/Edit Code, Deploy code changes

Question 2

Question
What would a developer do to update a picklist field on related Opportunity records when a modification to the associated Account record is detected?
Answer
  • Create a workflow rule with a field update
  • Create a Visualforce page
  • Create a Lightning Component
  • Create a process with Process Builder

Question 3

Question
In an organization that has enabled multiple currencies a developer needs to aggregate the sum of Estimated_Value__currency field from the Campaign Member object using a roll-up summary field Total_Estimated_Value__c on Campaign. How is the currency of the Total_Estimated_Value__c roll-up summary field determined?
Answer
  • The values in CampaignMember.Estimated_value__c are converted into the currency of the Campaign record, and the sum is displayed using the currency on the Campaign record.
  • The values in CampaignMember.Estimated_value__c are converted into the currency on the majority of the Campaign Member records and the sum is displayed using that currency.
  • The values in CampaignMember.Estimated_value__c are summed up and the resulting Total_estimated_value__c field is displayed as a numeric field on the Campaign record.
  • The values in CampaignMember.Estimated_value__c are converted into the currency of the current user, and the sum is displayed using the currency on the Campaign record

Question 4

Question
What is a valid Apex statement?
Answer
  • Integer w,x,y=123, z='abc';
  • Map conMap = [SELECT Name FROM Contact];
  • Private static constant Double rate = 7.75;
  • Account[] acctList = new List {new Account()};

Question 5

Question
A company has a custom object named Warehouse. Each Warehouse 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 the Warehouse?
Answer
  • Parent-Child
  • Lookup
  • Master-detail
  • One-to-Many

Question 6

Question
On which object can an administrator create a roll-up summary field?
Answer
  • Any object that is on the detail side of a master-detail relationship
  • Any object that is on the child side of a lookup relationship
  • Any object that is on the master side of a master-detail relationship
  • Any object that is on the parent side of a lookup relationship

Question 7

Question
Which code segment can be used to control when the dowork() method is called?
Answer
  • A. For(triggerIsRunning t : trigger.new){ doWork(); }
  • B. If(trigger.IsRunning){ doWork(); }
  • C. For (trigger.IsInsert t : trigger.new){ doWork(); }
  • D. If(trigger.IsInsert){ doWork(); }

Question 8

Question
When would a developer use a custom controller instead of a controller extension? Choose 2 answers
Answer
  • When a Visualforce page needs to replace the functionality of a standard controller
  • When a Visualforce page needs to add new actions to a standard controller
  • When a Visualforce page should not enforce permissions or field-level security
  • When a Visualforce page does not reference a single primary object

Question 9

Question
Why would a developer use Test.startTest() and Test.stopTest()?
Answer
  • To start and stop anonymous block execution when execution when executing anonymous Apex Code
  • To avoid Apex code coverage requirements for the code between these lines
  • To create an additional set of governor limits during the execution of a single test class
  • To indicate test code so that it does not impact Apex line count governor limits

Question 10

Question
When the number of record in a record set is unknown, which control statement should a developer use to implement a set of code that executes for every record in the record set without performing a size() or .length() method call?
Answer
  • While (Condition) {...}
  • For (init_stmt; exit_condition; increment_stmt) {...}
  • For(Variable : list_or_set){...}
  • Do {...} While (Condition)

Question 11

Question
What must the Controller for a VisualForce page utilize to override the Standard Opportunity view button?
Answer
  • The Standard Set Controller to support related lists for pagination.
  • A callback constructor to reference the Standard Controller
  • The Opportunity Standard Controller for pre-built functionality.
  • A constructor that initializes a private Opportunity variable.

Question 12

Question
Which type of code represents the Controller in MVC architecture on the Force.com platform? Choose 2 answers
Answer
  • Javascript that is used to make a menu item display itself
  • A static resource that contains CSS and images
  • StandardController system methods that are referenced by Visualforce
  • Custom Apex and Javascript code that is used to manipulate data

Question 13

Question
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. What can be done to resolve the failures and reduce the number of code changes needed for future validation rules? Choose 2 answers.
Answer
  • Create a method that loads valid Account records from a Static Resource, and call this method within test methods.
  • Create a method that queries for a valid Account records, and call this method from within test methods
  • Create a method that creates valid Account records, and call this method from within test methods
  • Create a method that performs a callout for a valid Account record, and call this method within test methods

Question 14

Question
A developer needs to automatically populate the Reports To 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? Choose 2 answers
Answer
  • Before update
  • After update
  • Before insert
  • After insert

Question 15

Question
What is a capability of cross-object formula fields? Choose 3 answers
Answer
  • Formula fields can expose data the user does not have access to in a record
  • Formula fields can reference fields from Master-Detail or lookup parent relationships
  • Formula fields can reference fields from objects that are up to 10 relationships away
  • Formula fields can be use in three roll-up summaries per object
  • Formula fields can reference fields in a collection of records from a child relationship

Question 16

Question
What is the result when a Visualforce page calls an Apex controller, which calls another Apex class, which then results in hitting a governor limit?
Answer
  • Any changes up to the error are saved
  • All changes before a save point are saved
  • Any changes up to the error are rolled back
  • All changes are saved in the first Apex Class

Question 17

Question
A developer has the following code block: Public class PaymentTax {Public static decimal salesTax = 0.0875;} Trigger OpportunityLineItemTrigger on OpportunityLineItem(before insert, before update){PaymentTax PayTax = new PaymentTax(); Decimal ProductTax = ProductCost = XXXXXXXXXXXXX; } To calculate the productTax wich code segment would a developer insert at the XXXXXXXX to make the value of the class variable SalesTax accessible within the trigger?
Answer
  • PayTax.SalesTax
  • SalesTax
  • PaymentTax.SalesTax
  • OpportunityLineItemTrigger.SalesTax

Question 18

Question
Which data structure is returned to a developer when performing a SOSL search?
Answer
  • A map of sObject types to a list of sObjects
  • A list of SObjects
  • A map of SObject types to a list of lists of Sobjects.
  • A list of lists of SObjects.

Question 19

Question
Which standard field needs to be populated when a developer inserts new Contact records programmatically?
Answer
  • AccountId
  • LastName
  • FirstName
  • Name

Question 20

Question
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 74% at least 75% test coverage is required. What can the developer do to successfully deploy the new Visualforce page and extension?
Answer
  • Select *Disable Parallel Apex testing * to run all the test
  • Select *fast Deployment* to bypass running all the tests.
  • Create test classes to exercise the visualforce page markup
  • Add test methods to existing test classes from previous deployments.

Question 21

Question
To which primitive data type in Apex is a currency field automatically assigned?
Answer
  • Currency
  • Integer
  • Decimal
  • Double

Question 22

Question
An sObject named Application__c has a lookup relationship to another sObject named Position__cBoth Application__c and Position__c have a picklist field namedStatus__c When the Status__c field on Position__c is updated, the Status__c field on Application__c needs automatically with the same value, and execute a workflow rule on Application__c. How can a developer accomplish this?
Answer
  • By changing Application__c.Status__c into a roll-up summary field
  • By using an Apex trigger with a DML operation
  • By changing Application__c.Status__c into a formula field
  • By Configuring a cross-object field update with a workflow

Question 23

Question
A company that uses a custom object to track candidates would like to send candidate information automatically to a third-party human resources system when a candidate is hired. What can a developer do to accomplish this task?
Answer
  • Create an escalation rule to the hiring manager.
  • Create a process builder with an outbound message action.
  • Create a workflow rule with an outbound message action.
  • Create an auto response rule to the candidate.

Question 24

Question
A developer needs to provide a Visualforce page that lets users enter Product-specific details during a Sales cycle. How can this be accomplished? Choose 2 answers
Answer
  • A. Download an Unmanaged Package from the AppExchange that provides a Custom Visualforce
  • B. Copy the standard page and then make a new Visualforce page for product data entry
  • C. Create a new Visualforce page and an Apex controller to provide Product data entry
  • D. Download a Managed Package from the AppExchange that provides a custom Visualforce

Question 25

Question
A developer runs the following anonymous code block: List<Account> acc = [SELECT Id FROM Account LIMIT 10]; Delete acc;Database.emptyRecycleBin(acc); system.debug(Limits.getDMLStatements()+1, 1 +Limits.getLimitDMLStatements()); What is the result?
Answer
  • 11, 150
  • 150, 2
  • 150, 11
  • 2, 150

Question 26

Question
A developer wrote a workflow email alert on case creation so that an email is sent to the case owner manager when is created.When will the email be sent?
Answer
  • Before Trigger execution
  • After Trigger execution
  • Before Committing to database
  • After Committing to database

Question 27

Question
Which component is available to deploy using Metadata API? Choose 2 answers
Answer
  • Account Layout
  • Case Feed Layout
  • Case Layout
  • Console Layout

Question 28

Question
What is an accurate statement about with sharing keyword? Choose 2 answers
Answer
  • Both inner and outer classes can be declared as with sharing
  • Inner classes do not inherit the sharing setting from the container class
  • Inner classes inherit the sharing setting from the container class
  • Either inner or outer classes can be declared as with sharing, but not both

Question 29

Question
On a visualforce page with a custom controller, how should a developer retrieve a record by using an ID that is passed on the URL?
Answer
  • Create a new PageReference object with the id
  • Use the tag in the visualforce page
  • Use the $Action. View method in the Visualforce page
  • Use the constructor method for the controller.

Question 30

Question
A developer needs to create records for the object Property__c .The developer creates the following code block: 01 List<Property__c> propertiesToCreate =helperClass.CreateProperties(); 02 Try { 03 04}Catch (Exception exp){ 05 //Exception handling 06 Which line of code would the developer insert at line 03 to ensure that at least some records are created, even if a few records have errors and fail to be created?
Answer
  • Datebase.insert(propertiesToCreate,System.ALLOW_PARTIAL);
  • Insert propertiesToCreate;
  • Database.insert(propertiesToCreate,false);
  • Database.insert(propertiesToCreate);

Question 31

Question
What is true of a partial sandbox that is not true of a full sandbox?Choose 2 answers
Answer
  • Use of change sets
  • More frequent refreshes
  • Only includes necessary metadata
  • Limited to 5gb of data

Question 32

Question
What is a Characteristic of the Lightning Component framework? Choose 2 answers
Answer
  • It works with existing Visualforce pages
  • It uses XML as its data format
  • It has an event- driven architecture
  • It includes responsive component

Question 33

Question
What is a valid statement about apex classes and interfaces? Choose 2 answers
Answer
  • Exception classes must end with the word exception
  • The default modifier for a class is private
  • A class can have multiple levels of inner class
  • The default modifier for an interface is private

Question 34

Question
What is valid source and destination pair that can send or receive change sets? Choose 2 Answer
Answer
  • Sandbox to Sandbox.
  • Developer edition to production
  • Developer edition to sandbox
  • Sandbox to production.

Question 35

Question
How would a developer use Schema Builder to delete a custom field from the Account object that was required for prototyping, but is no longer needed?
Answer
  • Delete the field from Schema Builder and then all references in the code will be removed.
  • Mark the field for deletion in Schema Builder and then delete it from the declarative UI.
  • Remove all references from the code and then delete the custom field from Schema Builder
  • Remove all the references in the code and then the field will be removed from Schema Builder

Question 36

Question
How can a developer avoid exceeding governor limits when using an apex trigger? Choose 2 answers.
Answer
  • By using Maps to hold data from query results
  • By performing DML transactions on lists of sObjects
  • By using a helper class that can be invoked from multiple triggers
  • By using the Database class to handle DML transactions

Question 37

Question
How can a developer refer to, or instantiate, a PageReference in Apex? Choose 2 Answers
Answer
  • By using a PageReference with a partial or full URL
  • By using the Page object and a Visualforce page name
  • By using the PageReference.Page() method with a partial or full URL
  • By using the ApexPages.Page() method with a Visualforce page name

Question 38

Question
When loading data into an organization, what can a developer do to match records to update existing records? Choose 2 answer
Answer
  • Match the name field to a column in the imported file
  • Match the Id field to a column in the imported file.
  • Match an external Id Text field to a column in the imported file.
  • Match an auto-generated Number field to a column in the imported file.

Question 39

Question
The Review__c object has a lookup relationship up to the Job_Application__c object. The job_application__c object has a master-detail relationship on the position__c object. The relationship field names are based on the auto-populated defaults. What is the recommended way to display field data from the related Review__c records on a Visualforce page for a single position__c record?
Answer
  • Utilize the Standard Controller for position__c and a Controller Extension to query for Review__c data
  • Utilize the Standard Controller for Position__c and cross-object Formula fields on the job_Application__c object to display Review__c data.
  • Utilize the Standard Controller for Position__c cross-object Formula fields on the Review__c object to display Review__c data.
  • Utilize the Standard Controller for position__c and expression syntax in the page to display related Review__c data through the job_Application__c object.

Question 40

Question
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?
Answer
  • Anonymous Blocks
  • HTTP Callouts
  • Apex Triggers
  • Apex Controllers

Question 41

Question
In Which order does Salesforce execute events upon saving a record?
Answer
  • Validation rules, Before Triggers, After Triggers, Workflow Rules, Assignment Rules, Commit
  • Before Triggers, Validation rules, After Triggers, Assignment Rules, Workflow Rules, Commit
  • Validation rules, Before Triggers, After Triggers, Assignment Rules, Workflow Rules, Commit
  • Before Triggers, Validation rules, After Triggers, Workflow Rules, Assignment Rules, Commit

Question 42

Question
Which resource can be included in a Lightning Component bundle? Choose 2 answers
Answer
  • Javascript
  • Apex class
  • Adobe Flash
  • Documentation

Question 43

Question
In the code below what types does boolean inherit from? boolean b = true
Answer
  • Class
  • Enum
  • Object
  • String

Question 44

Question
What is a correct pattern to follow when programming in Apex on a multi-tenant platform?
Answer
  • Queries select the fewest fields and records possible to avoid exceeding governor limits
  • Apex classes use the "with sharing" Keyword to prevent access from other server tenants
  • DML is performed on one record at a time to avoid possible data concurrency issues
  • Apex code is created in a separate environment from schema to reduce deployment errors

Question 45

Question
A developer writes a before insert trigger. How can the developer access the incoming records in the trigger body?
Answer
  • By accessing the Trigger.newList context variable
  • By accessing the Trigger.new context variable
  • By accessing the Trigger.newRecords context variable
  • By accessing the Trigger.newMap context variable

Question 46

Question
What is the preferred way to reference web content- such as images, stylesheets, JavaScript, and other libraries that is used in Visualforce pages?
Answer
  • By accessing the content from a third-party CDN
  • By uploading the content in the Documents tab
  • By accessing the content from a Chatter Files
  • By uploading the content as a Static Resource

Question 47

Question
Public class MyController1 {public String myString;Public String getMyString(){Return 'getMyString';}Public string getStringMethod1(){Return myString;}Public string getStringMethod2(){If(myString==null){myString='method2';}return mystring;}}<apex:page controller="MyController1">{!myString}, {!stringMethod1}, {!StringMethod2}, {!myString}</apex:page> What does the user see when accessing the custom object page?
Answer
  • GetMyString, , Method2, getMyString
  • GetMyString, , ,
  • , , Method2, getMyString
  • , , Method2,

Question 48

Question
A developer creates a Workflow Rule declaratively that updates afield on an object. An apex update trigger exists for the object.What happens when a user updates a record?
Answer
  • No changes are made to the data
  • Both the Apex Trigger and Workflow Rule are fired only once
  • The Apex Trigger is fired more than once
  • The Workflow Rule is fired more than once

Question 49

Question
A developer wants to display all the available record types for a case Object. The developer also wants to display the picklist values for the Case.Status field. The Case Object and the Case.Status field are on a Custom Visualforce page. Which action can the developer perform to get the record types and picklist values in the controller?
Answer
  • Use Schema.RecordTypeInfo returned by Case.SObjectType.getDescribe().getRecordTypeInfo();
  • Use Schema.PickListEntry returned by Case.Status.getDescribe().getPicklistValues();
  • Use SOQL to query Case records in the org to get all values for the Status picklist field
  • Use SOQL to query Case records in the org to get all the RecordType values available for Case

Question 50

Question
Which statement about the Lookup Relationship between a Custom object and a Standard Object is correct?
Answer
  • The Custom Object will be deleted when the referenced Standard Object is deleted
  • The lookup Relationship cannot be marked as required on the page layout for the Custom Object
  • The custom Object inherits security from the referenced Standard Object
  • The Lookup relationship on the Custom Object can prevent the deletion of the Standard Object

Question 51

Question
What is the minimum log level needed to see user generated debug statements?
Answer
  • DEBUG
  • FINE
  • WARN
  • INFO

Question 52

Question
When creating unit tests in Apex, Which statement is accurate?
Answer
  • Increased test coverage requires large test classes with many lines of code in one method
  • System Assert statements that do not increase code coverage contribute important feedback in unit
  • Unit tests with multiple methods result in all methods failing every time one method fails
  • Triggers do not require any unit tests in order to deploy them from sandbox to production

Question 53

Question
A developer has a single custom controller class that works with a Visualforce to support creating and editing multiple sObjects. The wizard accepts data from user inputs across multiple Visualforce pages and from a parameter on the initial URL.Which statements is unnecessary inside the unit test for the custom controller?
Answer
  • ApexPages.currentPage().getParameter.put(‘input’,’Testvalue’)
  • String nextPage = controller.save().getUrl();
  • Public ExtendedController(ApexPages.StandardController cntrl) {}
  • Test.setCurrentPage(PageRef)

Question 54

Question
A custom exception named "RecordNotFoundException" is defined by the following code block:public class RecordNotFoundException extends Exception { } Which statement can a developer use to throw the customexception? Choose 2 answers
Answer
  • Throw RecordNotFoundException('Problem occurred')
  • Throw new RecordNotFoundException();
  • Throw RecordNotFoundException();
  • Throw new RecordNotFoundException('Problem occurred')

Question 55

Question
The sales management team 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 to a Lead?
Answer
  • Validation rule
  • Process builder
  • Formula Field
  • Workflow rule

Question 56

Question
A developer has the following trigger that fires after insert and creates a child Case whenever a new Case is created. List<Case> childcases = new List<Case>();for(Case parent: Trigger.new){Case child = new Case(ParentId = parent.Id, Subject =parent.Subject);childCases.add(child);}insert childCases; What happens after the code block executes?
Answer
  • A child case is created for each parent case in Trigger.new
  • The trigger enters an infinite loop and eventually fails
  • The trigger fails if the Subject field on the parent is blank
  • Multiple child cases are created for each parent case in Trigger.new

Question 57

Question
What should a developer working in a sandbox use to exercise a new test class before the developer deploys that test class to production? Choose 2 answer
Answer
  • The REST API and Apex TestRun method
  • The test menu in the developer console.
  • The Apex Test Execution page in Salesforce Setup
  • The Run Test page in Salesforce Setup.

Question 58

Question
A developer created an Apex trigger using the Developer Consoleand now wants to debug code.How can the developer accomplish in the Developer Console?
Answer
  • Add the user name in the Log inspector.
  • Select the override Log triggers checkbox for the trigger
  • Open the Logs tab in the Developer Console
  • Open the Progress tab in the Developer Console.

Question 59

Question
Which requirement needs to be implemented by using standard workflow instead of Process Builder? Choose 2 answers
Answer
  • Create activities at multiple intervals
  • Submit a contract for approval
  • Send an outbound message without Apex code
  • Copy and account address to its contacts

Question 60

Question
A developer uses a before insert trigger on the Lead object to fetch the Territory__c object, where the Territory__c. PostalCode__c matches the Lead.PostalCode. The code fails when the developer uses the Apex Data Loader to insert 10,000 Lead records. The developer has the following code block: Which line of code is causing the code block to fail?
Answer
  • 03: A SOQL query is located inside of the for loop code
  • 01: Trigger.new is not valid in a before insert Trigger.
  • 02: a NullPointer exception is thrown if PostalCode is null.
  • 05: The Lead in a before insert Trigger cannot be updated

Question 61

Question
Which statement about change set deployments is accurate? Choose 3 answers
Answer
  • They require a deployment connection
  • They can be used to deploy custom settings data
  • They can be used to transfer Contact records
  • They use an all or none deployment model
  • They can be used only between related organizations

Question 62

Question
What is an accurate statement about variable scope? Choose 3 answers
Answer
  • A variable can be defined at any point in a block
  • Parallel blocks can use the same variable name
  • Sub-blocks cannot reuse a parent block's variable name
  • A static variable can restrict the scope to the current block if its values is null
  • Sub-blocks can reuse a parent ́s block variable name if its value is null

Question 63

Question
A company wants a recruiting app that models candidates and interviews; displays the total number of interviews on each candidate record; and defines security on interview records that is independent from the security on candidate records.What would a developer do to accomplish this task? Choose 2 answers.
Answer
  • Create a trigger on the Interview object that updates a field on the Candidate object
  • Create a roll-up summary field on the Candidate object that counts Interview records.
  • Create a lookup relationship between the Candidate and Interview objects.
  • Create a master-detail relationship between the Candidate and Interview objects.

Question 64

Question
Which scenario is invalid for execution by unit tests?
Answer
  • Executing methods as different users
  • Loading test data in place of user input for Flows.
  • Loading the standard Pricebook ID using a system method
  • Executing methods for negative test scenarios

Question 65

Question
A reviewer 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?
Answer
  • Create a required Visualforce component
  • Create a required comments field
  • Create a formula field
  • Create a validation rule

Question 66

Question
Which action can a developer perform in a before update trigger? Choose 2 answers
Answer
  • Update the original object using an update DML operation
  • Change field values using the Trigger.new context variable
  • Display a custom error message in the application interface
  • Delete the original object using a delete DML operation

Question 67

Question
Which is a valid way of loading external Javascript files into a VisualForce page? Choose 2 answers.
Answer
  • Using an <*apex:define*> tag
  • Using an <*apex:includeScript*> tag
  • Using a <*script*> tag
  • Using a <*link*> tag

Question 68

Question
When can a developer use a custom Visualforce page in a Force.com application?Choose 2 answers
Answer
  • To modify the page layout settings for a custom object
  • To create components for dashboards and layouts
  • To deploy components between two organizations
  • To generate a PDF document with application Data

Question 69

Question
In a single record, a user selects multiple values from a multi-select picklist.How are the selected values represented in Apex?
Answer
  • As a List with each value as an element in the list
  • As a Set with each value as an element in the set
  • As a String with each value separated by a semicolon
  • As a String with each value separated by a comma

Question 70

Question
A developer writes a SOQL query to find child records for a specific parent. How many levels can be returned in a single query?
Answer
  • 1
  • 7
  • 3
  • 5

Question 71

Question
Where would a developer build a managed package?
Answer
  • Partial Copy Sandbox
  • Developer Edition
  • Unlimited Edition
  • Developer Sandbox

Question 72

Question
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? Discuss
Answer
  • By using Limits.getDMLRows() and then displaying an error message before the number of DML statements is exceeded.
  • By using ApexMessage.Message() to display an error message after the number of DML statements is exceeded.
  • By using PageReference.setRedirect() to redirect the user to a custom Visualforce page before the number of DML statements is exceeded.
  • By using Messaging.SendEmail() to continue the transaction and send an alert to the user after the number of DML statements is exceeded

Question 73

Question
A developer needs to ensure there is sufficient test coverage for an Apex method that interacts with Accounts. The developer needs to create test data.What is the preferred way to load this test data into Salesforce?
Answer
  • By using WebServiceTests
  • By using Documents
  • By using Static Resources
  • By using HttpCalloutMocks

Question 74

Question
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?
Answer
  • Create a Workflow Rule to relate the Task to the Contact’s Account
  • Nothing. The Task cannot be related to an Account and a Contact
  • Create an Account formula field that displays the Task information
  • Nothing. The Task is automatically displayed on the Account Page.

Question 75

Question
A developer wants to create a custom object to track Customer Invoices.How should Invoices and Accounts be related to ensure that all Invoices are visible to everyone with access to an Account?
Answer
  • The Invoice should have a Master-Detail relationship to the Account
  • The Account should have a Master-Detail relationship to the Invoice.
  • The Account should have a Lookup relationship to the Invoice
  • The Invoice should have a Lookup relationship to the Account

Question 76

Question
A candidate may apply to multiple jobs at the company Universal Containers by submitting a single application per job posting. Once an application is submitted for a job posting, that application cannot be modified to be resubmitted to a different job posting.What can the administrator do to associate an application with each job posting in the schema for the organization?
Answer
  • Create a lookup relationship in the Applications custom object to the Job Postings custom object
  • Create a master-detail relationship in the Application custom object to the Job Postings custom object.
  • Create a lookup relationship on both objects to a junction object called Job Posting Applications.
  • Create a master-detail relationship in the Job Postings custom object to the Applications custom object.

Question 77

Question
A developer needs to create a Visualforce page that will override the Standard Account edit button. The page will be used to validate the account ́s address using a SOQL query. The page will also allow the user to make edits to the address.Where would the developer write the Account address verification logic?
Answer
  • In a Controller Extension
  • In a Standard Extension
  • In a Custom Controller
  • In a Standard Controller

Question 78

Question
What is a good practice for a developer to follow when writing a trigger? Choose 2 answers
Answer
  • Using synchronous callouts to call external systems
  • Using the Map data structure to hold query results by ID
  • Using @future methods to perform DML operations
  • Using the Set data structure to ensure distinct records

Question 79

Question
Which statement would a developer use when creating test data for products and pricebooks?
Answer
  • List objList= Test.loadData(Acccount.sObjectType, ',myResource')
  • IsTest(SeeAllData=false)
  • Id pricebookId = Test.getStandardPricebookId();
  • Pricebook pb = new pricebook();

Question 80

Question
Which declarative method helps ensure quality data? Choose 3 answers
Answer
  • Workflow alerts
  • Page layouts
  • Lookup filters
  • Validation rules
  • Exception handling

Question 81

Question
A developer needs to know if all tests currently pass in a Salesforce environment. Which feature can the developer use? Choose 2 answers.
Answer
  • Salesforce UI Apex Test Execution
  • Workbench Metadata Retrieval
  • Developer Console
  • ANT Migration Tool

Question 82

Question
A Hierarchy Custom Setting stores a specific URL for each profile in Salesforce. Which statement can a developer use to retrieve the correct URL for the current user ́s profile and display this on a Visualforce page
Answer
  • {!$Setup.Url_Settings__c[$Profile.Id].URL__c}
  • {!$Setup.Url_Settings_c.Instance[Profile.Id].URL__c}
  • {!$Setup.Url_Settings__c[Profile.Id].URL__c}
  • {!$Setup.Url_Settings__c.URL__c}

Question 83

Question
What is an important consideration when developing in a multi-tenant environment?
Answer
  • Governor limits prevent tenants from impacting performance in multiple orgs on the same instance
  • Unique domain names take the place of namespace for code developed for multiple orgs on multiple instances.
  • Org-wide data security determines whether other tenants can see data in multiple orgs on the same instance.
  • Polyglot persistence provides support for a global, multilingual user base in multiple orgs in multiple instances

Question 84

Question
A developer has the following query:Contact c = [SELECT id, firstname, lastname, email FROM Contact WHERE lastname = 'Smith'];What does the query return if there is no Contact with the last name = 'Smith'?
Answer
  • An error that no rows are found
  • A contact with empty
  • A contact initialized to null
  • An empty List of Contacts

Question 85

Question
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?
Answer
  • Add the TestVisible attribute to the Apex class
  • Add the SeeAllData attribute to the test class
  • Add the SeeAllData atrribute to the test methods
  • Add the TestVisible attribute to the Apex methods

Question 86

Question
How can a developer determine, from the DescribeSObjectResult, if the current user will be able to create records for an object in Apex?
Answer
  • By using the canCreatable() method
  • By using the isCreatable() method
  • By using the isInsertable() method
  • By using the hasAccess() method

Question 87

Question
Which user can edit a record after it has been locked for approval? Choose 2 answers
Answer
  • Any user with a higher role in the hierarchy
  • An administrator
  • Any user who approved the record previously
  • An user who is assigned as the current approver

Question 88

Question
What is a capability of a StandardSetController?Choose 2 answers
Answer
  • It allows pages to perform mass updates of records
  • It enforces field-level security when reading large record sets
  • It extends the functionality of a standard or custom controller
  • It allows pages to perform pagination with large record set

Question 89

Question
A developer needs to provide a Visualforce page that lets users enter Product specific details during a Sales cycle.How can this be accomplished? Choose 2 answers
Answer
  • Copy the standard page and then make a new Visualforce page for Product data entry.
  • Download an Unmanaged Package from the AppExchange that provides a custom Visualforce page to modify.
  • Create a new Visualforce page and an Apex controller to provide data entry.
  • Download a Managed Package from the AppExchange that provides a custom Visualforce page to modify.

Question 90

Question
Which type of information is provided by the Checkpoints tab in the Developer console?Choose 2 answers. A. Namespace
Answer
  • Namespace
  • Debug Statement
  • Time
  • Exception

Question 91

Question
In the Lightning Component framework, which resource can be used to fire events?Choose 2 answers
Answer
  • Third-party Javascript code.
  • Visualforce controller actions.
  • Javascript controller actions.
  • Third-party web service code.

Question 92

Question
A developer is creating an application to track engines and their parts. An individual part can be used in different types of engines. What data model should be used to track the data and to prevent orphan records?
Answer
  • Create a junction object to relate many engines to many parts through a lookup relationship
  • Create a master-detail relationship to represent the one-to-many model of engines to parts
  • Create a lookup relationship to represent how each part relates to the parent engine object.
  • Create a junction object to relate many engines to many parts through a master-detail relationship

Question 93

Question
The Sales Management team 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?
Answer
  • Create a Workflow Rule on the Opportunity object that updates a field on the parent Account.
  • Create a formula field on the Account object that performs a MAX on the Opportunity Close Date field
  • Create a trigger on the Account object that queries the Close Date of the most recent Opportunities.
  • Create a roll-up summary field on the Account object that performs a MAX on the Opportunity Close Date field.

Question 94

Question
Which statement should a developer avoid using inside procedural loops? Choose 2 answers
Answer
  • List contacts = [select id, salutation, firstname, lastname, email from Contact where accountId = :a.Id]
  • If(o.accountid = a.id)
  • Update contactList
  • System.debug('Amount of CPU time (in ms) used so far:' + Limits.getCpuTime());

Question 95

Question
Which data type or collection of data types can SOQL statements populate or evaluate to?Choose 3 answers
Answer
  • An Integer
  • A single sObject
  • A Boolean
  • A string
  • A list of sObjects

Question 96

Question
Which trigger event allows a developer to update fields in the Trigger.new list without using an additional DMLstatement?Choose 2 answers
Answer
  • After insert
  • Before insert
  • After update
  • Before update

Question 97

Question
What is the proper process for an Apex unit test?
Answer
  • Query for test data using SeeAllData= true. Execute runAllTests(). Verify that the results are correct.
  • Create data for testing. Execute runAllTests(). Verify that the results are correct.
  • Create data for testing. Call the method being tested. Verify that the results are correct.
  • Query for test data using SeeAllData= true. Call the method being tested. Verify that the results are correct.

Question 98

Question
Where can custom roll-up summary fields be created using Standard Object relationships? Choose 3 answers
Answer
  • On Account using Opportunity records
  • On Account using Case records
  • On Opportunity using Opportunity Product record
  • On Campaign using Campaign Member records
  • On Quote using Order records

Question 99

Question
Which code block returns the ListView of an Account object using the following debug statement? System.debug(Controller.getListViewOptions());
Answer
  • ApexPages.StandardSetController controller = new ApexPages.StandardSetController([SELECT Id FROM Account LIMIT 1]);
  • ApexPages.StandardController controller = new ApexPages.StandardController(Database.getQueryLocator('select Id from Account Limit 1'));
  • ApexPages.StandardController controller = new ApexPages.StandardController([SELECT Id FROM Account LIMIT 1]);
  • ApexPages.StandardSetController controller = new ApexPages.StandardSetController(Database.getQueryLocator('select Id from Account Limit 1'))

Question 100

Question
When the value of a field in an account record is updated, which method will update the value of a custom field in all related opportunities? Choose 2 answers
Answer
  • A cross-object formula field on the Account object.
  • A Workflow Rule on the Account object.
  • A process Builder on the Account object
  • An Apex trigger on the Account object.

Question 101

Question
How would a developer determine if a CustomObject__c record has been manually shared with the current user in Apex?
Answer
  • By querying CustomObject__share
  • By querying the role hierarchy.
  • By calling the isShared() method for the record
  • By calling the profile settings of the current user

Question 102

Question
Which standard field mandatorily needs to be populated when a developer inserts new Contact records programmatically?
Answer
  • Name
  • LastName
  • AccountID
  • FirstName

Question 103

Question
Visualforce components are similar to which type of tag library containing tag namespace prefixes?
Answer
  • ASP tag library
  • JSP tag library
  • ASP log file
  • DL JSP log file

Question 104

Question
On a Visualforce page with a custom controller, by using an ID parameter that is passed in the URL, how should a developer retrieve a record? Select all that apply.
Answer
  • Use the constructor method for the controller
  • Use the $Action.View method in the Visualforce page
  • Use the <apex:detail> tag in the Visualforce page
  • Create a new PageReference object with the Id

Question 105

Question
A Visualforce page has a standard controller for an object that has a lookup relationship to a parent object. How can a developer display data from the parent record on the page?
Answer
  • By adding a second standard controller to the page for the parent record
  • By using a roll-up summary field on the child record to include data from the parent record
  • By using SOQL on the Visualforce page to query for data from the parent record
  • By using merge field syntax to retrieve data from the parent record

Question 106

Question
Where would you find identical Force.com IDs?
Answer
  • Production and Full Copy Sandbox only
  • Production and Dev Sandbox only
  • Two developer orgs
  • Two Sandbox orgs
Show full summary Hide full summary

Similar

Salesforce PD1 Practice Exam 1
SFDC Forum
Salesforce PD1 Practice Exam 1
George Lee
Salesforce PD1 Practice Exam 1
George Lee
Spanish Adjectives (Describing People)
Niat Habtemariam
Criminal Law
jesusreyes88
Physics 2a + 2b
James Squibb
Plant Structure and Photosynthesis
Evangeline Taylor
Edexcel Additional Science Chemistry Topics 1+2
Amy Lashkari
PSBD TEST 2-2
Suleman Shah
2PR101 1. test - 2. část
Nikola Truong
General Pathoanatomy Final MCQs (301-400)- 3rd Year- PMU
Med Student