ExamGecko
Home Home / Salesforce / Certified Platform Developer II

Salesforce Certified Platform Developer II Practice Test - Questions Answers, Page 25

Question list
Search
Search

List of questions

Search

Related questions











A company has a custom object Sales_Help_Request__c that has a Lookup relationship to Opportunity. The Sales_Help_Request__c has a number field, Number_of_Hours__c, that represents the amount of time spent on the Sales_Help_Request__c.

A developer is tasked with creating a field, Total_Hours__c, on Opportunity that should be the sum of all of the Number_of_Hours__c values for the Sales_Help_Request__c records related to that Opportunity.

What should the developer use to implement this?

A.
A workflow rule on the Sales_Help_Request__c object
A.
A workflow rule on the Sales_Help_Request__c object
Answers
B.
A roll-up summary field on the Opportunity object
B.
A roll-up summary field on the Opportunity object
Answers
C.
A trigger on the Opportunity object
C.
A trigger on the Opportunity object
Answers
D.
A trigger on Sales_Help_Request__c
D.
A trigger on Sales_Help_Request__c
Answers
Suggested answer: D

In a VisualForce page with a VisualForce component that has rendered set to false when the page loads, how can a developer ensure it will show on a re-render?

A.
Set the re-render attribute of the component to true.
A.
Set the re-render attribute of the component to true.
Answers
B.
Perform a full page refresh since rendered elements cannot be re-rendered without refreshing.
B.
Perform a full page refresh since rendered elements cannot be re-rendered without refreshing.
Answers
C.
Set the rendered attribute of the component to true and re-render the component.
C.
Set the rendered attribute of the component to true and re-render the component.
Answers
D.
Set the rendered attribute of the component to true and re-render a parent component.
D.
Set the rendered attribute of the component to true and re-render a parent component.
Answers
Suggested answer: D

An org has a requirement that the Shipping Address on the Account must be validated by a thirdparty web service, before the Account is allowed to be inserted.

What is the optimal way to meet this requirement?

A.
Make a callout to the web service from a custom Visualforce controller.
A.
Make a callout to the web service from a custom Visualforce controller.
Answers
B.
Make a callout to the web service from a standard Visualforce controller.
B.
Make a callout to the web service from a standard Visualforce controller.
Answers
C.
Make a callout to the web service from an after insert trigger.
C.
Make a callout to the web service from an after insert trigger.
Answers
D.
Make a callout to the web service from a before insert trigger.
D.
Make a callout to the web service from a before insert trigger.
Answers
Suggested answer: B

A developer needs to store variables to control the style and behavior of a Lightning Web Component. Which feature should be used to ensure that the variables are testable in both Production and all Sandboxes?

A.
Custom Metadata
A.
Custom Metadata
Answers
B.
Custom Object
B.
Custom Object
Answers
C.
Custom Setting
C.
Custom Setting
Answers
D.
Custom Variable
D.
Custom Variable
Answers
Suggested answer: A

A developer wrote an Apex class to make several callouts to an external system.

If the URLs used in these callouts will change often, which feature should the developer use to minimize changes needed to the Apex class?

A.
Session Id
A.
Session Id
Answers
B.
Connected Apps
B.
Connected Apps
Answers
C.
Remote Site Settings
C.
Remote Site Settings
Answers
D.
Named Credentials
D.
Named Credentials
Answers
Suggested answer: D

A company manages information about their product offerings in custom objects named Catalog and Catalog Item. Catalog Item has a master-detail field to Catalog, and each Catalog may have as many as 100,000 Catalog Items.

Both custom objects have a CurrencylsoCode Text field that contains the currency code they should use. If a Catalog's CurrencylsoCode changes, all of its Catalog Items' CurrencylsoCodes should be changed as well.

What should a developer use to update the CurrencylsoCodes on the Catalog Items when the Catalog's CurrencylsoCode changes^5

A.
An after insert trigger on Catalog that updates the Catalog Items if the Catalog's CurrencylsoCode is different
A.
An after insert trigger on Catalog that updates the Catalog Items if the Catalog's CurrencylsoCode is different
Answers
B.
An after insert trigger on Catalog Item that updates the Catalog Items if the Catalog's CurrencylsoCode is different
B.
An after insert trigger on Catalog Item that updates the Catalog Items if the Catalog's CurrencylsoCode is different
Answers
C.
A Database.Schedulable and Database.Batchable class that queries the Catalog object and updates the Catalog Items if the Catalog CurrencylsoCode is different
C.
A Database.Schedulable and Database.Batchable class that queries the Catalog object and updates the Catalog Items if the Catalog CurrencylsoCode is different
Answers
D.
A Database.Schedulable and Database.Batchable class that queries the Catalog Item object and updates the Catalog Items if the Catalog CurrencylsoCode is different
D.
A Database.Schedulable and Database.Batchable class that queries the Catalog Item object and updates the Catalog Items if the Catalog CurrencylsoCode is different
Answers
Suggested answer: D

A company decides that every time an Opportunity is created, they want to create a follow up Task and assign it to the Opportunity Owner.

What should a developer use to implement the requirements?

A.
A Process Builder on Opportunity
A.
A Process Builder on Opportunity
Answers
B.
A trigger on Task
B.
A trigger on Task
Answers
C.
A trigger on Opportunity
C.
A trigger on Opportunity
Answers
D.
A Process Builder on Task
D.
A Process Builder on Task
Answers
Suggested answer: A

A developer is developing a reuseable Aura Component that will reside on an sObject Lightning Page with the following HTML snippet:

<aura:component implements="force:hasRecordId,flexipage:availableForAIIPageTypesM>

<div>Hello!</div>

</aura:component> How can the component's Controller get the context of the Lightning Page that the sObject is on without requiring additional test coverage?

A.
Set the sObject type as a component attribute.
A.
Set the sObject type as a component attribute.
Answers
B.
Add force:hasSobjectName to the implements.
B.
Add force:hasSobjectName to the implements.
Answers
C.
Use the getSObjectTypeQ method in an Apex class.
C.
Use the getSObjectTypeQ method in an Apex class.
Answers
D.
Create a design attribute and configure via App builder.
D.
Create a design attribute and configure via App builder.
Answers
Suggested answer: B

A developer has working business logic code, but sees the following error in the test class:

You have uncommitted work pending. Please commit or rollback before calling out. What is a possible solution?

A.
Rewrite the business logic and test classes with ©TestVisible set on the callout.
A.
Rewrite the business logic and test classes with ©TestVisible set on the callout.
Answers
B.
Set seeAIIData to "true" at the top of the test class, since the code does not fail in practice.
B.
Set seeAIIData to "true" at the top of the test class, since the code does not fail in practice.
Answers
C.
Call support for help with the target endpoint, as it is likely an external code error.
C.
Call support for help with the target endpoint, as it is likely an external code error.
Answers
D.
Use test.IsRunningTest() before making the callout to bypass it in test execution.
D.
Use test.IsRunningTest() before making the callout to bypass it in test execution.
Answers
Suggested answer: D

A developer needs to implement a system audit feature that allows users, assigned to a custom profile named "Auditors", to perform searches against the historical records in the Account object.

The developer must ensure the search is able to return history records that are between 12 and 24 months old.

Given the code below, which select statement should be inserted below as a valid way to retrieve the Account History records ranging from 12 to 24 month old?

A.
A.
Answers
B.
B.
Answers
C.
C.
Answers
D.
D.
Answers
Suggested answer: D
Total 408 questions
Go to page: of 41