Weekend Sale - Limited Time 70% Discount Offer - Ends in 0d 00h 00m 00s - Coupon code: mxmas70

Home > Salesforce > CRT-450 > CRT-450

CRT-450 Salesforce Certified Platform Developer 1 (SP25) Question and Answers

Question # 4

Which scenario is valid for execution by unit tests?

A.

Execute anonymous Apex as a different user.

B.

Generate a Visualforce PDF with getcontentaAsPDF ().

C.

Load data from a remote site with a callout.

D.

Set the created date of a record using a system method.

Full Access
Question # 5

Universal Containers has a Visualforce page that displays a table of every Container__c being rented by a given Account. Recently this page is failing with a view state limit because some of the customers rent over 10,000 containers.

What should a developer change about the Visualforce page to help with the page load errors?

A.

Implement pagination with an OffsetController.

B.

Implement pagination with a StandardSetController.

C.

Use JavaScript remoting with SOQL Offset.

D.

Use lazy loading and a transient List variable.

Full Access
Question # 6

Which two statements are true about using the @testSetup annotation in an Apex test class?

Choose 2 answers

A.

Records created in the test setup method cannot be updated in individual test methods.

B.

In a test setup method, test data is inserted once and made available for all test methods In the test class.

C.

A method defined with the @testSetup annotation executes once for each test method in the test class and counts towards system limits.

D.

The @testSetup annotation is not supported when the @isTest(SeeAllData=True) annotation is used .

Full Access
Question # 7

(Full question statement)

A developer is tasked with building a custom Lightning Web Component (LWC) to collectContactinformation. The form will be shared among different types of users in the org. There are security requirements stating that only certain fields should beeditable and visibleto certain groups of users.

What should the developer use in their Lightning Web Component to support the security requirements?

A.

lightning-input-field

B.

force:inputField

C.

aura:input

D.

ui:inputField

Full Access
Question # 8

What is a benefit of developing applications

A.

Enforced unit testing and code coverage best practices

B.

Access to predefined computing resources

C.

Preconfigured storage for big data

D.

Unlimited processing power and memory

Full Access
Question # 9

Universal Containers is developing a new Lightning web component for their marketing department. They want to ensure that the component is fine-tuned and provides a seamless user experience.

What are some benefits of using the Lightning Component framework?

A.

Better performance due to client-side rendering

B.

Automatic support for accessibility standards

C.

Compatibility with all web browsers

D.

Easy integration with third-party libraries

Full Access
Question # 10

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.

Formula field

B.

Record-triggered flow

C.

Roll-up summary field

D.

Apex trigger

Full Access
Question # 11

Universal Containers (UC) wants to lower its shipping cost while making the shipping process more efficient. The Distribution Officer advises UC to implement global addresses to allow multiple Accounts to share a default pickup address. The developer is tasked to create the supporting object and relationship for this business requirement and uses the Setup Menu to create a custom object called "Global Address".

Which field should the developer add to create the most efficient model that supports the business need?

A.

Add a master-detail field on the Global Address object to the Account object.

B.

Add a lookup field on the Global Address object to the Account object.

C.

Add a lookup field on the Account object to the Global Address object.

D.

Add a master-detail field on the Account object to the Global Address object.

Full Access
Question # 12

Which three Salesforce resources can be accessed from a Lightning web component?

Choose 3 answers

A.

Static resources

B.

All external libraries

C.

SVG resources

D.

Third-party web components

E.

Content asset files

Full Access
Question # 13

A company has a custom object, order __c, that has a required, unique external ID field called order Number__c.

Which statement should be used to perform the DML necessary to insert new records and update existing records in a list of Order __c records

using the external ID field?

A.

merge orders;

B.

merge orders Order Number_c;

C.

upsert orders Order Number c;

D.

upsert orders;

Full Access
Question # 14

A developer is creating a page that allows users to create multiple Opportunities. The developer is asked to verify the current user's default Opportunity record type, and set certain default values based on the record type before inserting the record.

How can the developer find the current user's default record type?

A.

Create the opportunity and check the opportunity. recordtype, which will have the record ID of the current user's default record type, before inserting.

B.

Query the Profile where the ID equals userinfo.getprofileID () and then use the profile opportunity. getdefaultresoratype (} method,

C.

Use the schema. Userinfo. Opportunity. getDefaultRecordType {) method.

D.

Use opportunity. sobjectTyps. getDeacribse().getRecordTypeInfos {) to get a list of record types, and iterate through them until isDefaultRecordtypeMapping {) is true.

Full Access
Question # 15

How should a developer write unit tests for a private method in an Apex class?

A.

Use the SeeAllData annotation.

B.

Add a test method in the Apex class.

C.

Mark the Apex class as global.

D.

Use the @TestVisible annotation.

Full Access
Question # 16

What does the Lightning Component framework provide to developers?

A.

Support for Classic and Lightning UIs

B.

Prebuilt components that can be reused

C.

Templates to create custom components

D.

Extended governor limits for applications

Full Access
Question # 17

Which statement describes the execution order when triggers are associated to the same object and event?

A.

Triggers are executed in the order they are modified.

B.

Trigger execution order cannot be guaranteed.

C.

Triggers are executed alphabetically by trigger name.

D.

Triggers are executed in the order they are created.

Full Access
Question # 18

A developer wants to send an outbound message when a record meets a specific criteria.

Which two features satisfy this use case?

A.

Flow Builder can be used to check the record criteria and send an outbound message.

B.

Approval Process can be used to check the record criteria and send an outbound message without Apex code.

C.

Entitlement Process can be used to check the record criteria and send an outbound message without Apex code.

D.

Next Best Action can be used to check the record criteria and send an outbound message.

Full Access
Question # 19

A developer created a trigger on the Account object and wants to test if the trigger is properly bulkified. The developer team decided that the trigger should be tested with 200 account records with unique names.

What two things should be done to create the test data within the unit test with the least amount of code?

Choose 2 answers

A.

Use the @isTest (seeAllData=true) annotation in the test class.

B.

Use the @isTest (isParallel=true) annotation in the test class.

C.

Create a static resource containing test data.

D.

Use Test, loadData to populate data in your test methods.

Full Access
Question # 20

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 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

A.

Query for existing opportunities outside the for loop.

B.

Check if all the required fields for Opportunity are being added on creation.

C.

Move the DML that saves opportunities outside the for loop.

D.

Use Database query to query the opportunities.

Full Access
Question # 21

A Salesforce administrator used Flow Builder to create a flow named "accountOnboarding". The flow must be used inside an Aura component.

Which tag should a developer use to display the flow in the component?

A.

lightning: flow

B.

lightning-low

C.

sure-flow

D.

aura: flow

Full Access
Question # 22

What is the result of the following code snippet?

public word doWork(Account acct) {

for (Integer i = 0; i <= 2007 i++) {

insert acct;

}

A.

Accounts are inserted.

B.

Account is inserted.

C.

200 Accounts are inserted.

D.

201 Accounts are inserted.

Full Access
Question # 23

How is a controller and extension specified for a custom object named "Notice" on a Visualforce page?

A.

apex:page standardController="Notice_c" extensions="myControllerExtension"”

B.

apex:page controllers="Notice_c, myContcollerExtension"

C.

apex:pege=Notice extends="myControllerExtension”

D.

apex:page controller="Notice_c" extensions="myControllerExtension"

Full Access
Question # 24

Universal Containers decides to use purely declarative development to build out a new Salesforce application.

Which two options can be used to build out the business logic layer for this application?

Choose 2 answers

A.

Record-Triggered Flow

B.

Batch Jobs

C.

Remote Actions

D.

Validation Rules

Full Access
Question # 25

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?

A.

Roll-up summary field of Bug_c on Account

B.

Master-detail field on Bug_c to Account

C.

Lookup field on Bug_c to Account

D.

Function object between Bug__c and Account

Full Access
Question # 26

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 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.

Use variable binding and replace the dynamic query with a static SOQL.

B.

Use the sacapeSingleQuotes method to sanitize the parameter before its use.

C.

Use the ¢Readonly annotation and the with sharing keyword on the class.

D.

Use a regular expression on the parameter to remove special characters.

Full Access
Question # 27

A developer is designing a new application on the Salesforce platform and wants to ensure it can support multiple tenants effectively.

Which design framework should the developer consider to ensure scalability and maintainability?

A.

Waterfall Model

B.

Flux (view, action, dispatcher, and store)

C.

Model-View-Controller (MVC)

D.

Agile Development

Full Access
Question # 28

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?

A.

Rewrite all Visualforce pages as Lightning components.

B.

Set the attribute enableLightning to true in the definition.

C.

Enable Available for Lightning Experience, Lightning Communities, and the mobile app on Visualforce pages used by the custom application.

D.

Incorporate the Salesforce Lightning Design System CSS stylesheet Into the JavaScript applications.

Full Access
Question # 29

Flow Builder uses an Apex action to provide additional information about multiple Contacts, stored in a custom class ContactInfo.

Which is the correct definition of the Apex method that gets the additional information?

A.

@InvocableMethod(label='Additional Info') public ContactInfo getInfo(Id contactId) { /* implementation */ }

B.

@InvocableMethod(label='Additional Info') public static List getInfo(List contactIds) { /* implementation */ }

C.

@InvocableMethod(label='Additional Info') public static ContactInfo getInfo(Id contactId) { /* implementation */ }

D.

@InvocableMethod(label='Additional Info') public List getInfo(List contactIds) { /* implementation */ }

Full Access
Question # 30

A developer created a trigger on the Account object. While testing the trigger, the developer sees the error message ‘Maximum trigger depth exceeded’.

What could be the possible causes?

A.

The developer does not have the correct user permission.

B.

The trigger is too long and should be refactored into a helper class.

C.

The trigger does not have sufficient code coverage.

D.

The trigger is getting executed multiple times.

Full Access
Question # 31

Developers at Universal Containers (UC) use version control to share their code changes, but they notice that when they deploy their code to different environments they often have failures. They decide to set up Continuous Integration (CI).

What should the UC development team use to automatically run tests as part of their CI process?

A.

Salesforce CLI

B.

Visual Studio Code

C.

Force.com Toolkit

D.

Developer Console

Full Access
Question # 32

A developer is alerted to an issue with a custom Apex trigger that is causing records to be duplicated.

What is the most appropriate debugging approach to troubleshoot the issue?

A.

Review the Historical Event logs to identify the source of the issue.

B.

Add system.debug statements to the code to track the execution flow and identify the issue.

C.

Use the Apex Interactive Debugger to step through the code and identify the issue.

D.

Disable the trigger in production and test to see if the issue still occurs.

Full Access
Question # 33

What are three considerations when using the @lnvocableMethod annotation in Apex?

Choose 3 answers

A.

Only one method using the @invecableMethod annotation can be defined per Apex class_

B.

A method using the @invecableMethod annotation can have multiple input parameters.

C.

A method using the @invocablemethod annotation must be declaredas static,

D.

GO A method using the @invocablemethod annotation must define a return value.

E.

A method using the @invocableMethod annotation can be declared as Public or Global.

Full Access
Question # 34

What should a developer use to script the deployment and unit test execution as part of continuous integration?

A.

VS Code

B.

Execute Anonymous

C.

Salesforce CLI

D.

Developer Console

Full Access
Question # 35

Universal Containers (UC) uses out-of-the-box order management, that has a Master-Detail relationship between Order and Order Line Item.

UC stores the availability date on each Order Line Item and Orders are only shipped when all of the Order Line Items are available.

Which method should be used to calculate the estimated ship date for an Order?

A.

Use a LATEST formula on each of the latest availability date fields.

B.

Use a CEILING formula on each of the latest availability date fields.

C.

Use a DAYS formula on each of the availability date fields and a COUNT Roll-Up Summary field on the Order.

D.

Use a MAX Roll-Up Summary field on the latest availability date fields.

Full Access
Question # 36

A developer has the following requirements:

• Calculate the total amount on an Order.

• Calculate the line amount for each Line Item based on quantity selected and price.

• Move Line Items to a different Order if a Line Item is not in stock.

Which relationship implementation supports these requirements on its own?

A.

Line Item has a re-parentable master-detail field to Order.

B.

Line Item has a re-parentable lookup field to Order.

C.

Order has a re-parentable lookup field to Line Item.

D.

Order has are-parentable master-detail field to Line Item.

Full Access
Question # 37

A developer identifies the following triggers on the Expense _c object:

The triggers process before delete, before insert, and before update events respectively.

Which two techniques should the developer implement to ensure trigger best practices are followed?

Choose 2 answers

A.

Unity all three triggers In a single trigger on the Expense__c object that Includes all events.

B.

Unify the before insert and before update triggers and use Flow for the delete action.

C.

Create helper classes to execute the appropriate logic when a record is saved.

D.

Maintain all three triggers on the Expense __c object, but move the Apex logic out of the trigger definition.

Full Access
Question # 38

Universal Containers wants Opportunities to no longer be editable when reaching the Closed/Won stage.

How should a developer accomplish this?

A.

Use a validation rule.

B.

Make fields as read-only on the page layout.

C.

Use the Process Automation settings.

D.

Use Flow Builder.

Full Access
Question # 39

A developer wants to improve runtime performance of Apex calls by caching results on the client.

What is the most efficient way to implement this and follow best practices?

A.

Decorate the server-side method with @AuraEnabled(cacheable=true).

B.

Call the setStorable() method on the action in the JavaScript client-side code.

C.

Decorate the server-side method with @AuraEnabled(storable=true).

D.

Set a cookie in the browser for use upon return to the page.

Full Access
Question # 40

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?

A.

Write a trigger on the Opportunity object and use tree sorting to sum the amount for all related child objects under the Opportunity.

B.

Use the Streaming API to create real-time roll-up summaries.

C.

Write a trigger on the child object and use an aggregate function to sum the amount for all related child objects under the Opportunity.

D.

Use the Metadata API to create real-time roll-up summaries.

Full Access
Question # 41

When the code executes, a DML exception is thrown.

How should a developer modify the code to ensure exceptions are handled gracefully?

A.

Implement the upset DML statement.

B.

Implement Change Data Capture.

C.

Implement a try/catch block for the DML.

D.

Remove null items from the list of Accounts.

Full Access
Question # 43

Which code statement includes an Apex method named updateAccounts in the class AccountController for use in a Lightning web component?

A.

import updateAccounts from "AccountControlles';

B.

import updateAccounts from "Salesforce/apex/AccountController:';

C.

import updateAccounts from "Account@ontroller.updateAccounts';

D.

import updateAccounts from "@salesforce/apex/AccountController.updateAccounts";

Full Access
Question # 44

A developer must write an Apex method that will be called from a Lightning component. The method may delete an Account stored in the accountRec variable.

Which method should a developer use to ensure only users that should be able to delete Accounts can successfully perform deletions?

A.

accountRec, isDeletable()

B.

Schema,sObjectType,Account, isDeletable ()

C.

accuntRec, sObjectType,isDeletable()

D.

Account,isDeleteable

Full Access
Question # 45

A developer wants to mark each Account in a List 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?

A.

An if-else statement, with a for loop inside

B.

A witch statement, with a for loop inside

C.

A for loop, with an if or if/else statement inside

D.

A for loop, with a switch statement inside

Full Access
Question # 46

What are three characteristics of change set deployments?

Choose 3 answers Sending a change set between two orgs requires a deployment connection.

A.

Change sets can deploy custom settings data.

B.

Change sets can only be used between related organizations.

C.

Deployment is done in a one-way, single transaction.

D.

Sending a change set between two orgs requires a deployment connection.

E.

Change sets can be used to transfer records.

Full Access
Question # 47

When using Salesforce DX, what does a developer need to enable to create and manage scratch orgs?

A.

Sandbox

B.

Environment Hub

C.

Production

D.

Dev Hub

Full Access
Question # 48

What are two characteristics related to formulas?

Choose 2 answers

A.

Formulas are calculated at runtime and are not stored in the database.

B.

Formulas can reference themselves.

C.

Formulas can reference values in related objects.

D.

Fields that are used in a formula field can be deleted or edited without editing the formula.

Full Access
Question # 49

Cloud Kicks has a multi-screen flow that its call center agents use when handling inbound service desk calls.

At one of the steps in the flow, the agents should be presented with a list of order numbers and dates that are retrieved from an external order management system in real time and displayed on the screen.

What should a developer use to satisfy this requirement?

A.

An outbound message

B.

An Apex REST class

C.

An Apex controller

D.

An invocable method

Full Access
Question # 50

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?

A.

Developer sandboxes.

B.

Full Copy sandboxes

C.

Developer orgs

D.

Scratch orgs

Full Access
Question # 51

Provide question feedback here (optional):

Based on this code, what is the value of x?

A.

4

B.

1

C.

2

D.

3

Full Access
Question # 52

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

A.

String nextPage = controller.save().getUrl ();

B.

ApexPages.currentPage ().getParametera(}.put{'input', "TeatValue');

C.

insert pageret;

D.

public Extendedcontroller (ApexPages.Standardcontraller entrl) { }

E.

Test. setCurrentPage (pageRef) ;

Full Access
Question # 53

Which two are best practices when it comes to Aura component and application event handling?

Choose 2 answers

A.

Try to use application events as opposed to component events.

B.

Reuse the event logic in a component bundle, by putting the logic in the helper.

C.

Use component events to communicate actions that should be handled at the application level.

D.

Handle low-level events in the event handler and re-fire them as higher-level events.

Full Access
Question # 54

Which three steps allow a custom Scalable Vector Graphic (SVG) to be included in a Lightning web component?

Choose 3 answers

A.

Import the static resource and provide a JavaScript property for it.

B.

Upload the SVG as a static resource.

C.

Reference the import in the HTML template.

D.

Import the SVG as a content asset file.

E.

Reference the property in the HTML template.

Full Access
Question # 55

Consider the following code snippet for a Visualforce page that is launched using a Custom Button on the Account detail page layout.

When the Save button is pressed the developer must perform a complex validation that involves multiple objects and, upon success, redirect the user to another Visualforce page.

What can the developer use to meet this business requirement?

A.

Apex

B.

trigger

C.

Controller

D.

extension

Full Access
Question # 56

Universal Containers wants to automatically assign new cases to the appropriate support representative based on the case origin. They have created a custom field on the Case object to store the support representative name.

What is the best solution to assign the case to the appropriate support representative?

A.

Use a trigger on the Case object.

B.

Use a formula field on the Case object.

C.

Use a validation rule on the Case object.

D.

Use an Assignment Flow element.

Full Access
Question # 57

The value of the account type field is not being displayed correctly on the page. Assuming the custom controller is properly referenced on the Visualforce page, what should the developer do to correct the problem?

A.

Add a getter method for the actType attribute.

B.

Change theAccount attribute to public.

C.

Add with sharing to the custom controller.

D.

Convert theAccount.Type to a String.

Full Access
Question # 58

A developer wants to get access to the standard price book in the org while writing a test class that covers an OpportunityLineltem trigger.

Which method allows access to the price book?

A.

Use Test .getStandardPricebookid() to get the standard price book ID.

B.

Use @isTest [SeeAllData=true| and delete the existing standard price book.

C.

Use @Testvisible to allow the test method to see the standard price book.

D.

Use Test. loadData () and a static resource to load a standard price book.

Full Access
Question # 59

A developer considers the following snippet of code:

Boolean isOK;

Integer x;

String theString = 'Hello';

if (isOK == false && theString == 'Hello') {

x = 1;

} else if (isOK == true && theString == 'Hello') {

x = 2;

} else if (isOK == null && theString == 'Hello') {

x = 3;

} else {

x = 4;

}

Based an this code, what is the value of x?

A.

1

B.

2

C.

3

D.

4

Full Access
Question # 60

As part of new feature development, a developer is asked to build a responsive application capable of responding to touch events, that will be executed on stateful clients.

Which two technologies are built on a framework that fully supports the business requirement? Choose 2 answers

A.

Lightning Web Components

B.

Visualforce Components

C.

Visualforce Pages

D.

Aura Components

Full Access
Question # 61

While developing an Apex class with custom search functionality that will be launched from a Lightning Web Component, how can the developer ensure only records accessible to the currently logged in user are displayed?

A.

Use the WITH SECURITY_ENFORCED clause within the SOQL.

B.

Use the inherited sharing keyword.

C.

Use the with sharing keyword.

D.

Use the without sharing keyword.

Full Access