Salesforce CRT-450 : Salesforce Certified Platform Developer I Part 2
Question #: 41
Topic #: 1
The operation manager at a construction company uses a custom object called Machinery to manage the usage and maintenance of its cranes and other machinery. The manager wants to be able to assign machinery to different constructions jobs, and track the dates and costs associated with each job. More than one piece of machinery can be assigned to one construction job.
What should a developer do to meet these requirements?
- Create a lookup field on the Construction Job object to the Machinery object.
B. Create a lookup field on the Machinery object to the Construction Job object.
C. Create a junction object with Master-Detail Relationship to both the Machinery object and the Construction Job object.
D. Create a Master-Detail Lookup on the Machinery object to the Construction Job object.
Selected Answer: C
Question #: 42
Topic #: 1
Which two strategies should a developer use to avoid hitting governor limits when developing in a multi-tenant environment? (Choose two.)
- Use collections to store all fields from a related object and not just minimally required fields.
B. Use methods from the ג€Limitsג€ class to monitor governor limits.
C. Use SOQL for loops to iterate data retrieved from queries that return a high number of rows.
D. Use variables within Apex classes to store large amounts of data.
Selected Answer: C
Question #: 43
Topic #: 1
Which set of roll-up types are available when creating a roll-up summary field?
- COUNT, SUM, MIN, MAX
B. AVERAGE, SUM, MIN, MAX
C. SUM, MIN, MAX
D. AVRAGE, COUNT, SUM, MIN, MAX
Selected Answer: A
Question #: 44
Topic #: 1
What is the result of the debug statements in testMethod3 when you create test data using testSetup in below code?
- Account0.Phone=333-8781, Account1.Phone=333-8780
B. Account0.Phone=888-1515, Account1.Phone=999-2525
C. Account0.Phone=333-8780, Account1.Phone=333-8781
D. Account0.Phone=888-1515, Account1.Phone=999-1515
Selected Answer: C
Question #: 45
Topic #: 1
Which three options allow a developer to use custom styling in a Visualforce page? (Choose three.)
- tag
B. Inline CSS
C. tag
D. tag
E. A static resource
Selected Answer: A
Question #: 46
Topic #: 1
A developer executes the following query in Apex to retrieve a list of contacts for each account:
List accounts = [Select ID, Name, (Select ID, Name from Contacts) from Account] ;
Which two exceptions may occur when it executes? (Choose two.)
- CPU limit exception due to the complexity of the query.
B. SOQL query row limit exception due to the number of contacts.
C. SOQL query limit exception due to the number of contacts.
D. SOQL query row limit exception due to the number of accounts.
Selected Answer: BD
Question #: 47
Topic #: 1
Which three tools can deploy metadata to production? (Choose three.)
- Change Set from Developer Org
B. Force.com IDE
C. Data Loader
D. Change Set from Sandbox
E. Metadata API
Selected Answer: BDE
Question #: 48
Topic #: 1
A developer needs to display all of the available fields for an object.
In which two ways can the developer retrieve the available fields if the variable myObject represents the name of the object? (Choose two.)
- Use myObject.sObjectType.getDescribe().fieldSet() to return a set of fields.
B. Use mySObject.myObject.fields.getMap() to return a map of fields.
C. Use Schema.describeSObjects(new String[]{myObject})[0].fields.getMap() to return a map of fields.
D. Use getGlobalDescribe().get(myObject).getDescribe().fields.getMap() to return a map of fields.
Selected Answer: CD
Question #: 49
Topic #: 1
How should a developer avoid hitting the governor limits in test methods?
- Use @TestVisible on methods that create records.
B. Use Test.loadData() to load data from a static resource.
C. Use @IsTest (SeeAllData=true) to use existing data.
D. Use Test.startTest() to reset governor limits.
Selected Answer: A
Question #: 50
Topic #: 1
Which three declarative fields are correctly mapped to variable types in Apex? (Choose three.)
- Number maps to Decimal.
B. Number maps to Integer.
C. TextArea maps to List of type String.
D. Date/Time maps to Dateline.
E. Checkbox maps to Boolean.
Selected Answer: ADE
Question #: 51
Topic #: 1
A developer is asked to set a picklist field to `˜Monitor’ on any new Leads owned by a subnet of Users.
How should the developer implement this request?
- Create an after insert Lead trigger.
B. Create a before insert Lead trigger.
C. Create a Lead Workflow Rule Field Update.
D. Create a Lead formula field.
Selected Answer: C
Question #: 52
Topic #: 1
A developer wants to override a button using Visualforce on an object.
What is the requirement?
- The controller or extension must have a PageReference method.
B. The standardController attribute must be set to the object.
C. The action attribute must be set to a controller method.
D. The object record must be instantiated in a controller or extension.
Selected Answer: C
Question #: 53
Topic #: 1
A lead object has a custom field Prior_Email__c. The following trigger is intended to copy the current Email into the Prior_Email__c field any time the Email field is changed:
Which type of exception will this trigger cause?
- A null reference exception
B. A compile time exception
C. A DML exception
D. A limit exception when doing a bulk update
Selected Answer: C
Question #: 54
Topic #: 1
How should a developer create a new custom exception class?
- public class CustomException extends Exception{}
B. CustomException ex = new (CustomException)Exception();
C. public class CustomException implements Exception{}
D. (Exception)CustomException ex = new Exception();
Selected Answer: A
Question #: 55
Topic #: 1
Which two number expressions evaluate correctly? (Choose two.)
- Double d = 3.14159;
B. Integer I = 3.14159;
C. Decimal d = 3.14159;
D. Long l = 3.14159;
Selected Answer: AC
Question #: 56
Topic #: 1
A developer needs to create a Visualforce page that displays Case data. The page will be used by both support reps and support managers. The Support Rep profile does not allow visibility of the Customer_Satisfaction__c field, but the Support Manager profile does.
How can the developer create the page to enforce Field Level Security and keep future maintenance to a minimum?
- Create one Visualforce Page for use by both profiles.
B. Use a new Support Manager permission set.
C. Create a separate Visualforce Page for each profile.
D. Use a custom controller that has the with sharing keywords.
Selected Answer: A
Question #: 57
Topic #: 1
When an Account’s custom picklist field called Customer Sentiment is changed to a value of `Confused`, a new related Case should automatically be created.
Which two methods should a developer use to create this case? (Choose two.)
- Process Builder
B. Apex Trigger
C. Custom Button
D. Workflow Rule
Selected Answer: B
Question #: 58
Topic #: 1
What are three characteristics of static methods? (Choose three.)
- Initialized only when a class is loaded
B. A static variable outside of the scope of an Apex transaction
C. Allowed only in outer classes
D. Allowed only in inner classes
E. Excluded from the view state for a Visualforce page
Selected Answer: B
Question #: 59
Topic #: 1
What are two uses for External IDs? (Choose two.)
- To create relationships between records imported from an external system.
B. To create a record in a development environment with the same Salesforce ID as in another environment
C. To identify the sObject type in Salesforce
D. To prevent an import from creating duplicate records using Upsert
Selected Answer: C
Question #: 60
Topic #: 1
A developer wrote a unit test to confirm that a custom exception works properly in a custom controller, but the test failed due to an exception being thrown.
Which step should the developer take to resolve the issue and properly test the exception?
- Use try/catch within the unit test to catch the exception.
B. Use the finally bloc within the unit test to populate the exception.
C. Use the database methods with all or none set to FALSE.
D. Use Test.isRunningTest() within the custom controller.
Selected Answer: B
Question #: 61
Topic #: 1
Which SOQL query successfully returns the Accounts grouped by name?
- SELECT Type, Max(CreatedDate) FROM Account GROUP BY Name
B. SELECT Name, Max(CreatedDate) FROM Account GROUP BY Name
C. SELECT Id, Type, Max(CreatedDate) FROM Account GROUP BY Name
D. SELECT Type, Name, Max(CreatedDate) FROM Account GROUP BY Name LIMIT 5
Selected Answer: B
Question #: 62
Topic #: 1
For which three items can a trace flag be configured? (Choose three.)
- Apex Trigger
B. Apex Class
C. Process Builder
D. User
E. Visualforce
Selected Answer: ABD
Question #: 63
Topic #: 1
A developer is asked to create a custom Visualforce page that will be used as a dashboard component.
Which three are valid controller options for this page? (Choose three.)
- Use a standard controller.
B. Use a standard controller with extensions.
C. Use a custom controller with extensions.
D. Do not specify a controller.
E. Use a custom controller.
Selected Answer: ABE
Question #: 64
Topic #: 1
A Platform Developer needs to implement a declarative solution that will display the most recent Closed Won date for all Opportunity records associated with an
Account.
Which field is required to achieve this declaratively?
- Roll-up summary field on the Opportunity object
B. Cross-object formula field on the Opportunity object
C. Roll-up summary field on the Account object
D. Cross-object formula field on the Account object
Selected Answer: B
Question #: 65
Topic #: 1
Which three statements are true regarding the @isTest annotation? (Choose three.)
- A method annotated @isTest(SeeAllData=true) in a class annotated @isTest(SeeAllData=false) has access to all org data.
B. A method annotated @isTest(SeeAllData=false) in a class annotated @isTest(SeeAllData=true) has access to all org data.
C. A class containing test methods counts toward the Apex code limit regardless of any @isTest annotation.
D. Products and Pricebooks are visible in a test even if a class is annotated @isTest(SeeAllData=false).
E. Profiles are visible in a test even if a class is annotated @isTest(SeeAllData=false).
Selected Answer: ABE
Question #: 66
Topic #: 1
A company wants to create an employee rating program that allows employees to rate each other. An employee’s average rating must be displayed on the employee record. Employees must be able to create rating records, but are not allowed to create employee records.
Which two actions should a developer take to accomplish this task? (Choose two.)
- Create a trigger on the Rating object that updates a fields on the Employee object.
B. Create a lookup relationship between the Rating and Employee object.
C. Create a roll-up summary field on the Employee and use AVG to calculate the average rating score.
D. Create a master-detail relationship between the Rating and Employee objects.
Selected Answer: AB
Question #: 67
Topic #: 1
Which two SOSL searches will return records matching search criteria contained in any of the searchable text fields on an object? (Choose two.)
- [FIND ‘Acme*’ IN ANY FIELDS RETURNING Account, Opportunity];
B. [FIND ‘Acme*’ RETURNING Account, Opportunity];
C. [FIND ‘Acme*’ IN ALL FIELDS RETURNING Account, Opportunity];
D. [FIND ‘Acme*’ IN TEXT FIELDS RETURNING Account, Opportunity];
Selected Answer: BC
Question #: 68
Topic #: 1
For which example task should a developer use a trigger rather than a workflow rule?
- To set the Name field of an expense report record to Expense and the Date when it is saved
B. To send an email to a hiring manager when a candidate accepts a job offer
C. To notify an external system that a record has been modified
D. To set the primary Contact on an Account record when it is saved
Selected Answer: A
Question #: 69
Topic #: 1
Which feature should a developer use to update an inventory count on related Product records when the status of an Order is modified to indicate it is fulfilled?
- Process Builder process
B. Lightning component
C. Visualforce page
D. Workflow rule
Selected Answer: A
Question #: 70
Topic #: 1
A developer has JavaScript code that needs to be called by controller functions in multiple Aura components by extending a new abstract component.
Which resource in the abstract Aura component bundle allows the developer to achieve this?
- helper.js
B. controller.js
C. superRender.js
D. renderer.js
Selected Answer: A
Question #: 71
Topic #: 1
Which option should a developer use to create 500 Accounts and make sure that duplicates are not created for existing Account Sites?
- Sandbox template
B. Data Loader
C. Data Import Wizard
D. Salesforce-to-Salesforce
Selected Answer: C
Question #: 72
Topic #: 1
Which two components are available to deploy using the Metadata API? (Choose two.)
- Lead Conversion Settings
B. Web-to-Case
C. Web-to-Lead
D. Case Settings
Selected Answer: AD
Question #: 73
Topic #: 1
Which three statements are true regarding cross-object formulas? (Choose three.)
- Cross-object formulas can reference fields from objects that are up to 10 relationships away.
B. Cross-object formulas can reference fields from master-detail or lookup relationships.
C. Cross-object formulas can reference child fields to perform an average.
D. Cross-object formulas can expose data the user does not have access to in a record.
E. Cross-object formulas can be referenced in roll-up summary fields.
Selected Answer: C
Question #: 74
Topic #: 1
Which two statements are true about Apex code executed in Anonymous Blocks? (Choose two.)
- The code runs with the permissions of the user specified in the runAs() statement.
B. The code runs with the permissions of the logged in user.
C. The code runs in system mode having access to all objects and fields.
D. All DML operations are automatically rolled back.
E. Successful DML operations are automatically committed.
Selected Answer: BE
Question #: 75
Topic #: 1
From which two locations can a developer determine the overall code coverage for a sandbox? (Choose two.)
- The Apex Test Execution page
B. The Test Suite Run panel of the Developer Console
C. The Apex classes setup page
D. The Tests tab of the Developer Console
Selected Answer: CD
Question #: 76
Topic #: 1
Which two practices should be used for processing records in a trigger? (Choose two.)
- Use a Map to reduce the number of SOQL calls.
B. Use @future methods to handle DML operations.
C. Use a Set to ensure unique values in a query filter.
D. Use (callout=true) to update an external system.
Selected Answer: AC
Question #: 77
Topic #: 1
Which two statements are acceptable for a developer to use inside procedural loops? (Choose two.)
- delete contactList;
B. contactList.remove(i);
C. Contact con = new Contact();
D. Account a = [SELECT Id, Name FROM Account WHERE Id = :con.AccountId LIMIT 1];
Selected Answer: BC
Question #: 78
Topic #: 1
What is the debug output of the following Apex code?
Decimal theValue;
System.debug(theValue);
- 0.0
B. null
C. Undefined
D. 0
Selected Answer: C
Question #: 79
Topic #: 1
A developer needs to provide a way to mass edit, update, and delete records from a list view.
In which two ways can this be accomplished? (Choose two.)
- Create a new Visualforce page and Apex Controller for the list view that provides mass edit, update, and delete functionality.
B. Download a managed package from the AppExchange that provides customizable Enhanced List Views and buttons.
C. Download an unmanaged package from the AppExchange that provides customizable mass edit, update, and delete functionality.
D. Configure the user interface and enable both inline editing and enhanced lists.
Selected Answer: AD
Question #: 80
Topic #: 1
Which type of code represents the Model in the MVC architecture when using Apex and Visualforce pages?
- A Controller Extension method that saves a list of Account records
B. Custom JavaScript that processes a list of Account records
C. A list of Account records returned from a Controller Extension method
D. A Controller Extension method that uses SOQL to query for a list of Account records
Selected Answer: A