ExamGecko
Home Home / Salesforce / Certified Platform Developer II

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

Question list
Search
Search

List of questions

Search

Related questions











ABC Company has an Apex process that makes multiple extensive database operation and web service callouts. The database processes and web services can take a length time to run and must be run sequentially.

How should the developer write this Apex code without running into governor limits and system limitations?

A.
Use Limits class to stop entire process once governor limits are reached.
A.
Use Limits class to stop entire process once governor limits are reached.
Answers
B.
Use multiple @future methods for each process and callout.
B.
Use multiple @future methods for each process and callout.
Answers
C.
Use Queueable Apex to chain the jobs to run sequentially.
C.
Use Queueable Apex to chain the jobs to run sequentially.
Answers
D.
Use Apex Scheduler to scheduled each process.
D.
Use Apex Scheduler to scheduled each process.
Answers
Suggested answer: A

A developer is integrated with a legacy on-premises SQL database.

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

A.
External Object
A.
External Object
Answers
B.
Lookup field
B.
Lookup field
Answers
C.
Formula field
C.
Formula field
Answers
D.
External Id field
D.
External Id field
Answers
Suggested answer: D

A developer wrote a test class that successfully asserts a trigger on Account. It fires and updates data correctly in a sandbox environment.

A salesforce admin with a custom profile attempts to deploy this trigger via a change set into the production environment, but the test class fails with an insufficient privileges error.

What should a developer do to fix the problem?

A.
Add system.runAs ( ) to the best class to execute the trigger as a user with the correct object permissions.
A.
Add system.runAs ( ) to the best class to execute the trigger as a user with the correct object permissions.
Answers
B.
Configure the production environment to enable "Run All tests as Admin User."
B.
Configure the production environment to enable "Run All tests as Admin User."
Answers
C.
Verify that Test, statement ( ) is not inside a For loop in the test class.
C.
Verify that Test, statement ( ) is not inside a For loop in the test class.
Answers
D.
Add seeAllData=true to the test class to work within the sharing model for the production environment.
D.
Add seeAllData=true to the test class to work within the sharing model for the production environment.
Answers
Suggested answer: A

A developer has requirement to query three fields (id, name, Type) from an Account and first and last names for all Contacts associated with the Account.

Which option is the preferred optimized method to achieve this for the Account named 'Ozene Electronics'?

A.
Account a = (SELECT ID, Name, Type from Account where name= Ozone Electronics;) list 1contacts = (SELECT firstname, lastname from Contacts where accountid=: a -ID0;
A.
Account a = (SELECT ID, Name, Type from Account where name= Ozone Electronics;) list 1contacts = (SELECT firstname, lastname from Contacts where accountid=: a -ID0;
Answers
B.
B.
Answers
C.
Account a = (SELECT ID, Name, Type, (select contat,firstName, Contact,LastName from Account, Contacts) from Account where name; Ozone Electronic' Limit 1 );
C.
Account a = (SELECT ID, Name, Type, (select contat,firstName, Contact,LastName from Account, Contacts) from Account where name; Ozone Electronic' Limit 1 );
Answers
D.
List 1Accounts = (Select ID, Name, Type from Account Join (Select ID, firstname, lastname form Contact where contact account , name 'ozone electronics));
D.
List 1Accounts = (Select ID, Name, Type from Account Join (Select ID, firstname, lastname form Contact where contact account , name 'ozone electronics));
Answers
E.
List 1Contacts = new list ( ); for(Contact c ; 1Select firstname, lastname Account, Name Account,ID Account, Type from Contact where Account: Name=' electronics')) ( iContacts.add(c);)
E.
List 1Contacts = new list ( ); for(Contact c ; 1Select firstname, lastname Account, Name Account,ID Account, Type from Contact where Account: Name=' electronics')) ( iContacts.add(c);)
Answers
Suggested answer: B

Consider the following code snippet, depicting an Azure component:

Which two interfaces can the developer implement to make the component available as a quick action?

Choose 2 answers

A.
Force:lightningQuicAction
A.
Force:lightningQuicAction
Answers
B.
Force:hasRecordId
B.
Force:hasRecordId
Answers
C.
Force hasObjectName
C.
Force hasObjectName
Answers
D.
Lightning QuickActionAPI
D.
Lightning QuickActionAPI
Answers
E.
Force:lightningQuickActionWithoutHeader
E.
Force:lightningQuickActionWithoutHeader
Answers
Suggested answer: A, E

Universal Containers stores user preferences in a Hierarchy Custom Setting, User_prefs_c, with a Checkbox field, show_Help_c, Company-Level defaults are stored at the organizational level, but may be overridden at the user level, If a user has not overridden preferences, then the defaults should be used.

How should the Show_Help_c preference be retrieved for the current user?

A.
Boolean show = User_Prefs_c, getinstance( ), Show_Help _c;
A.
Boolean show = User_Prefs_c, getinstance( ), Show_Help _c;
Answers
B.
Boolean show = User_Prefs_c, getValues ( ). Show _Help_c;
B.
Boolean show = User_Prefs_c, getValues ( ). Show _Help_c;
Answers
C.
Boolean show = User_Prefs_c, getvaluesUserInfo.getUserid() ).Show_Help_c;
C.
Boolean show = User_Prefs_c, getvaluesUserInfo.getUserid() ).Show_Help_c;
Answers
D.
Boolean show = User prefs_c, Show_Help_c;
D.
Boolean show = User prefs_c, Show_Help_c;
Answers
Suggested answer: C

An org has a requirement that addresses on Contacts and Accounts should be normalized to a company standard by Apex code any time that they are saved.

What is the optimal way to implement this?

A.
Apex trigger on Account that calls the Contact trigger to normalize the address
A.
Apex trigger on Account that calls the Contact trigger to normalize the address
Answers
B.
Apex trigger on Contact that calls the Account trigger to normalize the address
B.
Apex trigger on Contact that calls the Account trigger to normalize the address
Answers
C.
Apex trigger on Account that and Account that normalized the address
C.
Apex trigger on Account that and Account that normalized the address
Answers
D.
Apex trigger on Account and Account that call a helper class to normalize the address
D.
Apex trigger on Account and Account that call a helper class to normalize the address
Answers
Suggested answer: D

Which technique can run logic when an Aura Component is loaded?

A.
Use an aura:handler 'init" event to call a function.
A.
Use an aura:handler 'init" event to call a function.
Answers
B.
Use the connectedCallback(0 method.
B.
Use the connectedCallback(0 method.
Answers
C.
Use the standard doinit function in the controller.
C.
Use the standard doinit function in the controller.
Answers
D.
Call $A. enqueueAction passing in the method to call.
D.
Call $A. enqueueAction passing in the method to call.
Answers
Suggested answer: A

A developer wants to write a generic Apex method that will compare the Salesforce Name filed between any two object records, for example to compare the Name field of an Account and an Opportunity; or the name of an Account and a Contact.

How should the developer do this?

A.
Use a String.replace( ) method to parse the contents of each Name field.
A.
Use a String.replace( ) method to parse the contents of each Name field.
Answers
B.
Invoke a Schema,describe() function to compare the values of each Name field.
B.
Invoke a Schema,describe() function to compare the values of each Name field.
Answers
C.
Cast each object into an sObject and use sObject.get(Name') to compare the Name fields.
C.
Cast each object into an sObject and use sObject.get(Name') to compare the Name fields.
Answers
D.
Use the salesforce metadata API to extract the value of each object and compare the name fields
D.
Use the salesforce metadata API to extract the value of each object and compare the name fields
Answers
Suggested answer: C

Explanation:

Topic 2, Exam Pool B

When calling a RESTful web service, a developer receives a JSON payload that has a data hierarchy that is nested three levels deep. How can the developer describe the external data?

A.
Deserialize the data untyped and then process it.
A.
Deserialize the data untyped and then process it.
Answers
B.
Declare a class with three levels and deserialize the JSON typed with this class.
B.
Declare a class with three levels and deserialize the JSON typed with this class.
Answers
C.
Use the ANT migration tool, the custom metadata API, or the Dataloader.
C.
Use the ANT migration tool, the custom metadata API, or the Dataloader.
Answers
D.
Use middleware to flatten the JSON and consume it as a new custom object.
D.
Use middleware to flatten the JSON and consume it as a new custom object.
Answers
Suggested answer: A
Total 408 questions
Go to page: of 41