CRT-450 Salesforce Certified Platform Developer 1 Exam Questions and Answers
A developer has a single custom controller class that works with a Visualforce Wizard 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 three statements are useful inside the unit test to effectively test the custom controller?
Choose 3 answers
Which two are best practices when it comes to Aura component and application event handling?
Choose 2 answers
Universal Containers wants to assess the advantages of declarative development versus programmatic customization for specific use cases in its Salesforce implementation.
What are two characteristics of declarative development over programmatic customization?
Choose 2 answers
A software company uses the following objects and relationships:
* Case: to handle customer support issues
* Defect__c: a custom object to represent known issues with the company ' s software
* Case Defect__c a junction object between Case and Defect __c to represent that a defect is a cause of a customer issue
Case and Defect__c have Private organization-wide defaults.
What should be done to share a specific Case_Defect__c record with a user?
Which two events need to happen when deploying to a production org?
Choose 2 answers
Universal Containers wants a list button to display a Visualforce page that allows users to edit multiple records.
Which Visualforce feature supports this requirement?
(Full question statement)
Universal Containers recently transitioned fromClassic to Lightning Experience. One of its business processes requirescertain values from the Opportunity objectto be sent via anHTTP REST calloutto itsexternal order management systemwhen the user presses a custom button on the Opportunity detail page.
Example fields:
Name
Amount
Account
Which two methods should the developer implement to fulfill the business requirement?
Choose 2 answers.
A developer needs to have records with specific field values in order to test a new Apex class.
What should the developer do to ensure the data is available to the test?
A Developer Edition org has five existing accounts. A developer wants to add 10 more accounts for testing purposes.
The following code is executed in the Developer Console using the Execute Anonymous window:
How many total accounts will be in the org after this code is executed?
A developer needs to implement a custom SOAP Web Service that is used by an external Web Application. The developer chooses to include helper methods that are not used by the Web Application in the implementation of the Web Service Class.
Which code segment shows the correct declaration of the class and methods?
A developer has a Visualforce page and custom controller to save Account records. The developer wants to display any validation rule violations to the user.
How can the developer make sure that validation rule violations are displayed?
A developer must perform a complex SOQL query that joins two objects in a Lightning component.
How can the Lightning component execute the query?
Universal Containers has developed custom Apex code and Lightning Components in a Sandbox environment. They need to deploy
the code and associated configurations to the Production environment.
What is the recommended process for deploying the code and configurations to Production?
What is the value of the Trigger.old context variable in a before insert trigger?
A developer has an integer variable called maxAttempts. The developer needs to ensure that once maxAttempts is initialized, it preserves its value for the length of the Apex transaction; while being able to share the variable ' s state between trigger executions.
How should the developer declare maxAttempts to meet these requirements?
Which code in a Visualforce page and/or controller might present a security vulnerability?
What are two ways a developer can get the status of an enqueued job for a class that implements the queueable interface?
Choose 2 answers
A developer is tasked to perform a security review of the ContactSearch Apex class that exists in the system. Within the class, the developer identifies the following method as a security threat:
ist < Contact > performSearch (String lastName} [
return Database.query( ' SELECT Id, FirstName, LastName FROM Contact WHERE LastName Like
s ' +lastName+ ' s ' " )?;
What are two ways the developer can update the method to prevent a SOQL injection attack?
Choose 2 answers
A developer creates a Lightning web component that imports a method within an Apex class. When a Validate button is pressed, the method runs to execute complex validations.
In this implementation scenario, which two options are.. of the Controller according to the MVC architecture?
Choose 2 answers
Where are two locations a developer can look to find information about the status of batch or future methods?
Choose 2 answers
Assuming that name is a String obtained by a Visualforce page, which two SOQL queries performed are safe from SOQL injection? (Choose two.)
Universal Containers has a large number of custom applications that were built using a third-party JavaScript framework and exposed using Visualforce pages. The company wants to update these applications to apply styling that resembles the look and feel of Lightning Experience.
What should the developer do to fulfill the business request in the quickest and most effective manner?
Management asked for opportunities to be automatically created for accounts with annual revenue greater than $1, 000,000. A developer created the following trigger on the Account object to satisfy this requirement.
for (Account a : Trigger.new) {
if (a.AnnualRevenue > 1000000) {
List < Opportunity > oppList = [SELECT Id FROM Opportunity WHERE AccountId = :a.Id];
if (oppList.size() == 0) {
Opportunity oppty = new Opportunity(Name = a.Name, StageName = ' Prospecting ' , CloseDate = System.today().addDays(30));
insert oppty;
}
}
}
Users are able to update the account records via the UI and can see an opportunity created for high annual revenue accounts. However, when the administrator tries to upload a list of 179 accounts using Data Loader, it fails with system, Exception errors.
Which two actions should the developer take to fix the code segment shown above?
Choose 2. answers
The orderHelper class is a utility class that contains business logic for processing orders. Consider the following code snippet:
Public class without sharing orderHelper {// code implementation
}
A developer needs to create a constant named delivery_multiplier with a value of 4.15. The value of the constant should not change at any time in the code.
How should the developer declare the delivery multiplier constant to meet the business objectives?
A developer wants to mark each Account in a List < Account > as either Active or Inactive, based on the value in the LastModified each Account being greater than 90 days in the past.
Which Apex technique should the developer use?
Which two statements are true about using the @testSetup annotation in an Apex test class?
Choose 2 answers
(Full question statement)
Which code displays the contents of a Visualforce page as a PDF?
What are three considerations when using the @lnvocableMethod annotation in Apex?
Choose 3 answers
A developer created these three Rollup Summary fields in the custom object, Project__c:
The developer is asked to create a new field that shows the ratio between rejected and approved timesheets for a given project.
Which should the developer use to implement the business requirement in order to minimize maintenance overhead?
A company decides to implement a new process where every time an Opportunity is created, a follow up Task should be created and assigned to the Opportunity Owner.
What is the most efficient way for a developer to implement this?
A developer needs to create a baseline set of data (Accounts, Contacts, Products, Assets) for an entire suite of Apex tests allowing
them to test isolated requirements for various types of Salesforce cases.
Which approach can efficiently generate the required data for each unit test?
When a user edits the Postal Code on an Account, a custom Account text field named " Timezone " must be updated based on the values in another custom object called PostalCodeToTimezone__c.
What is the optimal way to implement this feature?
A custom object Trainer__c has a lookup field to another custom object Gym__c.
Which SOQL query will get the record for the Viridian City Gym and all it ' s trainers?
A software company is using Salesforce to track the companies they sell their software to in the Account object. They also use Salesforce to track bugs in their software with a custom object, Bug__c.
As part of a process improvement initiative, they want to be able to report on which companies have reported which bugs. Each company should be able to report multiple bugs and bugs can also be reported by multiple companies.
What is needed to allow this reporting?
What are three characteristics of change set deployments?
Choose 3 answers Sending a change set between two orgs requires a deployment connection.
An Apex method, getAccounts, that returns a List of Accounts given a searchTerm, is available for Lightning Web Components to use.
What is the correct definition of a Lightning Web Component property that uses the getAccounts method?
A developer needs to prevent the creation of Request__c records when certain conditions exist in the system. A RequestLogic class exists that checks the conditions.
What is the correct implementation?
A developer is asked to prevent anyone other than a user with Sales Manager profile from changing the Opportunity Status to Closed Lost if the lost reason is blank.
Which automation allows the developer to satisfy this requirement in the most efficient manner?
Given the following Apex statement:
Account myAccount = [SELECT Id, Name FROM Account);
What occurs when more than one Account is returned by the SOQL query?
A developer at AW Computing is tasked to create the supporting test class for a programmatic customization that leverages records stored within the custom object, Pricing Structure c. AW Computing has a complex pricing structure for each item on the store, spanning more than 500 records.
Which two approaches can the developer use to ensure Pricing _Structure__c records are available when the test class is executed?
Choose 2 answers
Refer to the following Apex code:
apex
Copy
Integer x = 0;
do {
x++;
} while (x < 1);
System.debug(x);
What is the value of x when it is written to the debug log?
(Full question statement)
Which statement generates a list ofLeadsandContactsthat have a field containing the phrase " ACME " ?
A developer must create a Lightning component that allows users to input Contact record information to create a Contact record, including a Salary__c custom field.
What should the developer use, along with a lightning-record-edit-form, so that Salary__c field functions as a currency input and is only viewable and editable by users that have the correct field-level permissions on Salary__c?
A developer deployed a trigger to update the status__c of Assets related to an Account when the Account’s status changes and a nightly integration that updates Accounts in bulk has started to fail with limit failures.
What should the developer change about the code to address the failure while still having the code update all of the Assets correctly?
A lead developer creates an Apex interface called Laptop.
Consider the following code snippet:
apex
CopyEdit
public class SilverLaptop {
// code implementation
}
How can a developer use the Laptop interface within the SilverLaptop class?
How can a developer check the test coverage of autolaunched Flows before deploying them in a change set?
A team of developers is working on a source-driven project that allows them to work independently, with many different org configurations.
Which type of Salesforce orgs should they use for their development?
The sales management team at Universal Containers requires that the Lead Source field of the Lead record be populated when a Lead is converted What should be done to ensure that a user populates the Lead Source field prior to converting a Lead?
(Full question statement)
Universal Containers wants Opportunities to no longer be editable when they reach the Closed/Wonstage.
Which two strategies can a developer use to accomplish this?
Choose 2 answers.
Which three code lines are required to create a Lightning component on a Visualforce page?
Choose 3 answers.
When a user edits the Postal Code on an Account, a custom Account text field named " Timezone " must be updated based on the values in a PostalCodeToTimezone__c custom object.
Which two automation tools can be used to implement this feature? Choose 2 answers
What is the result of the following code snippet?
public word doWork(Account acct) {
for (Integer i = 0; i < = 2007 i++) {
insert acct;
}
Universal Containers needs to create a custom user interface component that allows users to enter information about their accounts.
The component should be able to validate the user input before saving the information to the database.
What is the best technology to create this component?
An Opportunity needs to have an amount rolled up from a custom object that is not in a master-detail relationship.
How can this be achieved?
What should a developer use to obtain the Id and Name of all the Leads, Accounts, and Contacts that have the company name " Universal Containers?
