Pass the Salesforce Developers CRT-450 Questions and answers with CertsForce

Viewing page 3 out of 7 pages
Viewing questions 21-30 out of questions
Questions # 21:

Universal Containers has implemented an order management application. Each Order can have one or more Order Line items. The Order Line object is related to the Order via a master-detail relationship. For each Order Line item, the total price is calculated by multiplying the Order Line item price with the quantity ordered.

What is the best practice to get the sum of all Order Line item totals on the Order record?

Options:

A.

Roll-up summary field


B.

Formula field


C.

Apex trigger


D.

Quick action


Expert Solution
Questions # 22:

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

Options:

A.

Lightning Web Components


B.

Visualforce Components


C.

Visualforce Pages


D.

Aura Components


Expert Solution
Questions # 23:

A developer is integrating with a legacy on-premise SQL database.

What should the developer use to ensure the data being integrated is matched to the right records in Salesforce?

Options:

A.

External Object


B.

External ID field


C.

Formula field


D.

Lookup field


Expert Solution
Questions # 24:

Consider the following code snippet:

apex

CopyEdit

public class with sharing AccountsController {

@AuraEnabled

public List getAllAccounts(){

return [SELECT Id, Name, Industry FROM Account];

}

}

Apex Test Class Snippet:

apex

CopyEdit

@isTest

private class with sharing AccountsController_Test {

@testSetup

private static void makeData(){

User user1 = [SELECT Id FROM User WHERE Profile.Name = 'System Administrator' AND isActive = true LIMIT 1];

User user2 = [SELECT Id FROM User WHERE Profile.Name = 'Standard User' AND UserName = 'test@test.com' AND isActive = true LIMIT 1];

TestUtils.insertAccounts(10, user1.Id);

TestUtils.insertAccounts(20, user2.Id);

}

@isTest

private static void getAllAccounts_StandardUser_Test(){

List result = AccountsController.getAllAccounts();

System.assertEquals(20, result.size());

}

}

When the test class runs, the assertion fails.

Which change should the developer implement in the Apex test method to ensure the test method executes successfully?

Options:

A.

Query the Administrator user into memory and enclose lines 15 and 16 within the System.runAs(user); method.


B.

Query the Standard User into memory and enclose lines 15 and 16 within the System.runAs(); method.


C.

Add @isTest(seeAllData=true); to line 12 and enclose lines 15 and 16 within Test.startTest(); and Test.stopTest();.


D.

Add System.runAs(user); to line 14 and enclose line 15 within Test.startTest(); and Test.stopTest();.


Expert Solution
Questions # 25:

A developer has identified a method in an Apex class that performs resource intensive actions in memory by iterating over the result set of a SOQL statement on the account. The method also performs a DML statement to save the changes to the database.

Which two techniques should the developer implement as a best practice to ensure transaction control and avoid exceeding governor limits'*

Choose 2 answers

Options:

A.

Use the @ReadOnly annotation to bypass the number of rows returned by a SOQL.


B.

Use partial DML statements to ensure only valid data is committed.


C.

Use the System.limit class to monitor the current CPU governor limit consumption.


D.

Use the Database.Savepoint method to enforce database integrity.


Expert Solution
Questions # 26:

A developer is migrating a Visualforce page into a Lightning web component.

The Visualforce page shows information about a single record. The developer decides to use Lightning Data Service to access record data.

Which security consideration should the developer be aware of?

Options:

A.

Lightning Data Service ignores field-level security.


B.

The with sharing keyword must be used to enforce sharing rules.


C.

Lightning Data Service handles sharing rules and field-level security.


D.

The isAccessible () method must be used for field-level access checks.


Expert Solution
Questions # 27:

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?

Options:

A.

Formula field


B.

Record-triggered flow


C.

Roll-up summary field


D.

Apex trigger


Expert Solution
Questions # 28:

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?

Options:

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.


Expert Solution
Questions # 29:

Which exception type cannot be caught?

Options:

A.

custom exception


B.

LinkException


C.

NoAccessException


D.

CelloutException


Expert Solution
Questions # 30:

What is the value of the Trigger.old context variable in a before insert trigger?

Options:

A.

An empty list of sObjects


B.

Undefined


C.

null


D.

A list of newly created sObjects without IDs


Expert Solution
Viewing page 3 out of 7 pages
Viewing questions 21-30 out of questions