Salesforce CRT-450 : Salesforce Certified Platform Developer I Part 3
Question #: 81
Topic #: 1
Requirements state that a child record is deleted when its parent is deleted, and a child can be moved to a different parent when necessary.
Which type of relationship should be built between the parent and child objects in Schema builder to support these requirements?
- Master-Detail relationship
B. Child relationship
C. Lookup relationship from the parent to the child
D. Lookup relationship from the child to the parent
Selected Answer: D
Question #: 82
Topic #: 1
Which tag should a developer include when styling from external CSS is required in a Visualforce page?
- apex:includeStyles
B. apex:includeScript
C. apex:require
D. apex:stylesheet
Selected Answer: B
Question #: 83
Topic #: 1
Managed Packages can be created in which type of org?
- Developer Sandbox
B. Partial Copy Sandbox
C. Unlimited Edition
D. Developer Edition
Selected Answer: B
Question #: 84
Topic #: 1
A developer has the following class and trigger code.
Which code segment should a developer insert at the XXX to set the baseCost variable to the value of the class variable smokerCharge?
- InsuranceRates.smokerCharge
B. rates.getSmokerCharge()
C. ContactTrigger.InsuranceRates.smokerCharge
D. rates.smokerCharge
Selected Answer: A
Question #: 85
Topic #: 1
A developer can use the debug log to see which three types of information? (Choose three.)
- HTTP callouts to external systems
B. Database changes
C. Resource usage and limits
D. User login events
E. Actions triggered by time-based workflow
Selected Answer: ABC
Question #: 86
Topic #: 1
Which three data types can be returned from an SOQL statement? (Choose three.)
- Boolean
B. List of sObjects
C. Single sObject
D. Integer
E. String
Selected Answer: BCD
Question #: 87
Topic #: 1
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 up to 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 Position_c record on a Visualforce page for a single Review_c record?
- Use the Standard Controller for Review_c and cross-object Formula Fields on the Position_c object to display Position_c data.
B. Use the Standard Controller for Job_Application_c and a Controller Extension to query for Position_c data.
C. Use the Standard Controller for Job_Application_c and cross-object Formula Fields on the Review_c object to display Position_c data.
D. Use the Standard Controller for Review_c and expression syntax in the Page to display related Position_c data through the Job_Application_c object.
Selected Answer: D
Question #: 88
Topic #: 1
Which action can a developer take to reduce the execution time of the following code?
- Put the Account loop inside the Contact loop.
B. Create an Apex helper class for SOQL.
C. Add a GROUP BY clause to the Contact SOQL.
D. Use a Map for allContacts.
Selected Answer: D
Question #: 89
Topic #: 1
Given the code below, what can be done so that recordCount can be accessed by a test class, but not by a non-test class?
- Change recordCount from private to public.
B. Add the SeeAllData annotation to the test class.
C. Add the TestVisible annotation to recordCount.
D. Add the TestVisible annotation to the MyController class.
Selected Answer: C
Question #: 90
Topic #: 1
Which message is logged by the code below?
- Generic Exception
B. List Exception
C. NullPointer Exception
D. No message is logged.
Selected Answer: C
Question #: 91
Topic #: 1
Which governor limit applies to all the code in an Apex transaction?
- Elapsed SOQL query time
B. Number of classes called
C. Number of new records created
D. Elapsed CPU time
Selected Answer: D
Question #: 92
Topic #: 1
An Apex transaction inserts 100 Account records and 2,000 Contact records before encountering a DML exception when attempting to insert 500 Opportunity records.
The Account records are inserted by calling the database.insert() method with the allOrNone argument set to false. The Contact and Opportunity records are inserted using the standalone insert statement.
How many total records will be committed to the database in this transaction?
- 2,000
B. 2,100
C. 0
D. 100
Selected Answer: C
Question #: 93
Topic #: 1
The sales team at Universal Containers would like to see a visual indicator appear on both Account and Opportunity page layouts to alert salespeople when an
Account is late making payments or has entered the collections process.
What can a developer implement to achieve this requirement without having to write custom code?
- Formula Field
B. Workflow Rule
C. Quick Action
D. Roll-up Summary Field
Selected Answer: A
Question #: 94
Topic #: 1
Which is a valid Apex assignment?
- Integer x=5*1.0;
B. Integer x =5.0;
C. Double x =5;
D. Float x =5.0;
Selected Answer: C
Question #: 95
Topic #: 1
The Account object has a custom Percent field, Rating, defined with a length of 2 with 0 decimal places. An Account record has the value of 50% in its Rating field and is processed in the Apex code below after being retrieved from the database with SOQL.
What is the value of acctScore after this code executes?
- 5
B. 50
C. 500
D. 5000
Selected Answer: D
Question #: 96
Topic #: 1
Which situation prevents a developer from setting sharing rules for a custom object?
- The object’s Sharing Settings is set to Public Read/Write.
B. The object is on the detail side of a Master-Detail relationship.
C. The developer is not a System Administrator.
D. The object is referenced in an Owner field of a Master-Detail relationship.
Selected Answer: B
Question #: 97
Topic #: 1
A developer wants to store a description of a product that can be entered on separate lines by a user during product setup and later displayed on a Visualforce page for shoppers.
Which field type should the developer choose to ensure that the description will be searchable in the custom Apex SOQL queries that are written?
- Text Area
B. Text
C. Text Area (Long)
D. Text Area (Rich)
Selected Answer: A
Question #: 98
Topic #: 1
A developer wants multiple test classes to use the same set of test data.
How should the developer create the test data?
- Reference a test utility class in each test class.
B. Define variables for test records in each test class.
C. Create a Test Setup method for each test class.
D. Use the SeeAllData=true annotation in each test class.
Selected Answer: A
Question #: 99
Topic #: 1
A developer wants to display all of the picklist entries for the Opportunity StageName field and all of the available record types for the Opportunity object on a
Visualforce page.
Which two actions should the developer perform to get the available picklist values and record types in the controller? (Choose two.)
- Use Schema.RecordTypeInfo returned by Opportunity.SObjectType.getDescribe().getRecordTypeInfos().
B. Use Schema.PicklistEntry returned by Opportunity.SObjectType.getDescribe().getPicklistValues ().
C. Use Schema.RecordTypeInfo returned by RecordType.SObjectType.getDescribe().getRecordTypeInfos().
D. Use Schema.PicklistEntry returned by Opportunity.StageName.getDescribe().getPicklistValues ().
Selected Answer: AD
Question #: 100
Topic #: 1
In order to override a standard action with a Visualforce page, which attribute must be defined in the tag?
- pageReference
B. override
C. controller
D. standardController
Selected Answer: D
Question #: 101
Topic #: 1
Which feature allows a developer to create test records for use in test classes?
- Documents
B. WebServiceTests
C. HttpCalloutMocks
D. Static Resources
Selected Answer: D
Question #: 102
Topic #: 1
How many levels of child records can be returned in a single SOQL query from one parent object?
- 1
B. 3
C. 5
D. 7
Selected Answer: A
Question #: 103
Topic #: 1
Which two declarative process automation features can be directly invoked when a field value changes on a record? (Choose two.)
- Cloud Flow Designer flows
B. Process Builder processes
C. Validation rules
D. Workflow rules
Selected Answer: BD
Question #: 104
Topic #: 1
How can a developer warn users of SOQL governor limit violations in a trigger?
- Use Messaging.SendEmail() to continue the transaction and send an alert to the user after the number of SOQL queries exceeds the limit.
B. Use PageReference.setRedirect() to redirect the user to a custom Visualforce page before the number of SOQL queries exceeds the limit.
C. Use Limits.getQueries() and display an error message before the number of SOQL queries exceeds the limit.
D. Use ApexMessage.Message() to display an error message after the number of SOQL queries exceeds the limit.
Selected Answer: D
Question #: 105
Topic #: 1
Which control statement should a developer use to ensure that a loop body executes at least once?
- for (init_stmt; exit_condition; increment_stmt) {ג€¦}
B. do {ג€¦} while (condition)
C. while (condition) {ג€¦}
D. for (variable : list_or_set) {ג€¦}
Selected Answer: B
Question #: 106
Topic #: 1
A developer creates a custom controller and custom Visualforce page by using the code block below.
What can the user expect to see when accessing the custom page?
- a, b, b
B. a, b, getMyString
C. a, a, a
D. b, a, getMyString
Selected Answer: C
Question #: 107
Topic #: 1
An Account trigger updates all related Contacts and Cases each time an Account is saved using the following two DML statements: update allContacts; update allCases;
What is the result if the Case update exceeds the governor limit for maximum number of DML records?
- The Account save fails and no Contacts or Cases are updated.
B. The Account save succeeds and no Contacts or Cases are updated.
C. The Account save succeeds, Contacts are updated, but Cases are not.
D. The Account save is retried using a smaller trigger batch size.
Selected Answer: A
Question #: 108
Topic #: 1
A company has a custom object named Region. Each Account in Salesforce can only be related to one Region at a time, but this relationship is optional.
Which type of relationship should a developer use to relate an Account to a Region?
- Parent-Child
B. Hierarchical
C. Lookup
D. Master-Detail
Selected Answer: C
Question #: 109
Topic #: 1
How can a developer get all of the available record types for the current user on the Case object?
- Use DescribeSObjectResult of the Case object.
B. Use SOQL to get all Cases.
C. Use DescribeFieldResult of the Case.RecordType field.
D. Use Case.getRecordTypes().
Selected Answer: A
Question #: 110
Topic #: 1
A developer needs to create an audit trail for records that are sent to the recycle bin.
Which type of trigger is most appropriate to create?
- after delete
B. after undelete
C. before undelete
D. before delete
Selected Answer: A
Question #: 111
Topic #: 1
In which three areas can a Lightning component be used in the Lightning Experience? (Choose three.)
- Lightning Report page
B. Lightning Connect page
C. Lightning Record Page
D. Lightning Community Page
E. Lightning Home page
Selected Answer: A
Question #: 112
Topic #: 1
Using DescribeSObjectResult, which Apex method can a developer use to determine if the current user can edit records for an object?
- canUpdate()
B. canEdit()
C. isUpdateable()
D. isEditable()
Selected Answer: C
Question #: 113
Topic #: 1
A change set deployment from a sandbox to production fails due to a failure in a managed package unit test. The developer spoke with the managed package owner and they determined it is a false positive and can be ignored.
What should the developer do to successfully deploy?
- Select ג€Run local testsג€ to run all tests in the org that are not in the managed package.
B. Select ג€Fast Deployג€ to run only the tests that are in the change set.
C. Select ג€Run local testsג€ to run only the tests that are in the change set.
D. Edit the managed package’s unit test.
Selected Answer: A
Question #: 114
Topic #: 1
Candidates are reviewed by four separate reviewers and their comments and scores which range from 1 (lowest) to 5 (highest) are stored on a review record that is a detail record for a candidate.
What is the best way to indicate that a combined review score of 15 or better is required to recommend that the candidate come in for an interview?
- Use a Validation Rule on a total score field on the candidate record that prevents a recommended field from being true if the total score is less than 15.
B. Use a Rollup Summary field to calculate the sum of the review scores, and store this in a total score field on the candidate.
C. Use Visual Workflow to set a recommended field on the candidate whenever the cumulative review score is 15 or better.
D. Use a Workflow Rule to calculate the sum of the review scores and send an email to the hiring manager when the total is 15 or better.
Selected Answer: A
Question #: 115
Topic #: 1
A developer needs to find information about @future methods that were invoked.
From which system monitoring feature can the developer see this information?
- Scheduled Jobs
B. Apex Jobs
C. Background Jobs
D. Asynchronous Jobs
Selected Answer: B
Question #: 116
Topic #: 1
When a Task is created for a Contact, how can a developer prevent the task from being included on the Activity Timeline of the Contact’s Account record?
- In Activity Setting, uncheck Roll up activities to a contact’s primary account.
B. Create a Task trigger to set the Account field to NULL.
C. Use Process Builder to create a process to set the Task Account field to blank.
D. By default, tasks do not display on the Account Activity Timeline.
Selected Answer: A
Question #: 117
Topic #: 1
A developer needs to save a List of existing Account records named myAccounts to the database, but the records do not contain Salesforce Id values. Only the value of a custom text field configured as an External ID with an API name of Foreign_Key__c is known.
Which two statements enable the developer to save the records to the database without an Id? (Choose two.)
- Upsert myAccounts Foreign_Key__c;
B. Upsert myAccounts(Foreign_Key__c);
C. Database.upsert (myAccounts, Foreign_Key__c);
D. Database.upsert(myAccounts).Foreign_Key__c;
Selected Answer: AC
Question #: 118
Topic #: 1
Which standard field is required when creating a new Contact record?
- LastName
B. Name
C. AccountId
D. FirstName
Selected Answer: A
Question #: 119
Topic #: 1
An org has a data model with a Buyer__c object that has a lookup relationship to Region__c and a Supplier__c object has a lookup relationship to Region___c.
How can a developer display data from the related Supplier__c records on a Visualforce page that has a standard controller for the Buyer__c object?
- Use rollup formula fields on the Buyer__c object to reference the related Supplier__c records through the Region__c.
B. Use SOQL in a controller extension to query for related Supplier__c records.
C. Use a second standard controller for the Region__c object on a page to display the related Supplier__c records.
D. Use merge field syntax to retrieve the Supplier__c records related to the Buyer__c record through the Region__c.
Selected Answer: B
Question #: 120
Topic #: 1
What can be used to delete components from production?
- A change set deployment with a destructiveChanges XML file
B. A change set deployment with the delete option checked
C. An ant migration tool deployment with a destructiveChanges XML file and an empty package.xml file
D. An ant migration tool deployment with a desctuctiveChanges XML file and the components to delete in the package.xml file
Selected Answer: C