SALESFORCE CERTIFICATIONS Certified Platform Developer IICertified Platform Developer II - Practice Questions - Post 9

SALESFORCE CERTIFICATIONS Certified Platform Developer IICertified Platform Developer II - Practice Questions - Post 9

1. A Visualforce page loads slowly due to the large amount of data it displays. Which strategy can a developer use to improve the performance?

Page: Page 1

Option A: Use Javascript to move data processing to the browser instead of the controller.

Option B: Use the transient keywords for the List variables used in the custom controller.

Option C: Use lazy loading to load the data on demand, instead of the controller’s constructor.

Option D: Use an in the page to load all of the data asynchronously.

Answer(s): 3

Explanation: Not available

SEO Keywords: SEO keywords not available


2. Universal Containers wants to use a Customer Community with Customer Community Plus licenses so their customers can track how many containers they are renting and when they are due back. Many of their customers are global companies with complex Account hierarchies, representing various departments within the same organization. One of the requirements is that certain community users within the same Account hierarchy be able to see several departments’ containers, based on a junction object that relates the Contact to the various Account records that represent the departments. Which solution solves these requirements?

Page: Page 1

Option A: A Visualforce page that uses a Custom Controller that specifies without sharing to expose the records

Option B: A Custom List View on the junction object with filters that will show the proper records based on owner

Option C: A Custom Report Type and a report Lightning Component on the Community Home Page

Option D: An Apex Trigger that creates Apex Managed Sharing records based on the junction object’s relationships

Answer(s): 3

Explanation: Not available

SEO Keywords: SEO keywords not available


3. Universal Containers wants to use an external Web Service provided by a third-party vendor to validate that shipping and billing addresses are correct. The current vendor uses basic password authentication, but Universal Containers might switch to a different vendor who uses OAuth. What would allow Universal Containers to switch vendors without updating the code to handle authentication?

Page: Page 1

Option A: Custom Metadata

Option B: Custom Setting (List)

Option C: Dynamic Endpoint

Option D: Named Credential

Answer(s): 4

Explanation: Not available

SEO Keywords: SEO keywords not available


4. A company has a Lightning Page with many Lightning Components, some that cache reference data. It is reported that the page does not always show the most current reference data. What can a developer use to analyze and diagnose the problem in the Lightning Page?

Page: Page 1

Option A: Salesforce Lightning Inspector Actions Tab

Option B: Salesforce Lightning Inspector Event Log Tab

Option C: Salesforce Lightning Inspector Transactions Tab

Option D: Salesforce Lightning Inspector Storage Tab

Answer(s): 4

Explanation: Not available

SEO Keywords: SEO keywords not available


5. {!v.account.Name} {!v.account.AccountNumber} {!v.account.Industry} Refer to the component code above. The information displays as expected (in three rows) on a mobile device. However, the information is not displaying as desired (in a single row) on a desktop or tablet. Which option has the correct component changes to display correctly on desktops and tablets?

Page: Page 2

Answer(s):

Explanation: Not available

SEO Keywords: SEO keywords not available


6.

Page: Page 2

Answer(s):

Explanation: Not available

SEO Keywords: SEO keywords not available


7.

Page: Page 2

Answer(s):

Explanation: Not available

SEO Keywords: SEO keywords not available


8.

Page: Page 2

Answer(s):

Explanation: Not available

SEO Keywords: SEO keywords not available


9. An Apex class does not achieve expected code coverage. The testSetup method explicitly calls a method in the Apex class. How can the developer generate the code coverage?

Page: Page 3

Option A: Verify the user has permissions passing a user into System.runAs().

Option B: Call the Apex class method from a testMethod instead of the testSetup method.

Option C: Add @testVisible to the method in the class the developer is testing.

Option D: Use system.assert() in testSetup to verify the values are being returned.

Answer(s): 2

Explanation: Not available

SEO Keywords: SEO keywords not available


10. A developer is trying to decide between creating a Visualforce component or a Lightning component for a custom screen. Which functionality consideration impacts the final decision?

Page: Page 3

Option A: Does the screen need to be rendered as a PDF?

Option B: Does the screen need to be accessible from the Lightning Experience UI?

Option C: Will the screen make use of a JavaScript framework?

Option D: Will the screen be accessed via a mobile app?

Answer(s): 1

Explanation: Not available

SEO Keywords: SEO keywords not available


11. A developer wishes to improve runtime performance of Apex calls by caching results on the client. What is the best way to implement this?

Page: Page 3

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

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

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

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

Answer(s): 1

Explanation: Not available

SEO Keywords: SEO keywords not available


12. A developer is asked to update data in an org based on new business rules. The new rules state that Accounts with the type set to 'Customer' should have a status of 'Active', and Accounts with the type set to 'Prospect' should have a status of 'Pending'. No other changes to data should be made. Which code block will accurately meet the business requirements?

Page: Page 3

Option A: Map statusMap = new Map{'Customer'=>'Active', 'Prospect'=>'Pending'} List accountUpdates = new List(); for ( Account a : [SELECT Id, Type FROM Account]){ if ( statusMap.containsKey(a.Type) ) { a.Status = a.Type == 'Customer' ? 'Active' : 'Pending'; } accountUpdates.add(a); } update accountUpdates;

Option B: Map statusMap = new Map{'Customer'=>'Active', 'Prospect'=>'Pending'} List accountUpdates = new List(); for ( Account a : [SELECT Id, Type FROM Account WHERE Status IN :statusMap.keySet()]){ a.Status = statusMap.get(a.Type); accountUpdates.add(a); } update accountUpdates;

Option C: List accountUpdates = new List(); for ( Account a : [SELECT Id, Type FROM Account]){ if ( String.isNotBlank(a.Type) && a.Type == 'Customer' ){ a.Status = 'Active'; } if ( String.isNotBlank(a.Type) && a.Type == 'Prospect' ){ a.Status = 'Pending'; } accountUpdates.add(a); } update accountUpdades;

Option D: List accountUpdates = new List(); for ( Account a : [SELECT Id, Type FROM Account]){ a.Status = a.Type == 'Customer' ? 'Active' : 'Pending'; accountUpdates.add(a); } update accountUpdates;

Answer(s): 3

Explanation: Not available

SEO Keywords: SEO keywords not available


13. What is a benefit of JavaScript remoting over Visualforce Remote Objects?

Page: Page 4

Option A: Allows for specified re-render targets

Option B: Does not require any Apex code

Option C: Does not require any JavaScript code

Option D: Supports complex server-side application logic

Answer(s): 4

Explanation: Not available

SEO Keywords: SEO keywords not available


14. A Lightning Component functions in preview mode and needs to be used inside a Lightning App Builder page, but it is not available. What change should be applied to the component?

Page: Page 4

Option A: Expose it in the markup using the implements and access attributes.

Option B: Delete the component, metadata, and Apex controller and recreate them.

Option C: Refresh the sandbox and upgrade it to the latest API version.

Option D: Look for errors in the logic in the JavaScript controller.

Answer(s): 1

Explanation: Not available

SEO Keywords: SEO keywords not available


15. Recently a Salesforce org's integration failed because it exceeded the number of allowed API calls in a 24-hour period. The integration handles a near real-time, complex insertion of data into Salesforce. The flow of data is as follows: -The integration looks up Contact records with a given email address and, if found, the integration adds a Task to the first matching Contact it finds. -If a match is not found, the integration looks up Lead records with a given email address and, if found, the integration adds a Task to the first matching Lead it finds. -If a match is not found, the integration will create a Lead and a Task for that newly created Lead. What is one way in which the integration can stay near real-time, but not exceed the number of allowed API calls in a 24-hour period?

Page: Page 4

Option A: Use the REST API as well as the SOAP API to effectively double the API calls allowed in a 24-hour period.

Option B: Create an Inbound Message that, using Flow, can do all of the logic the integration code was doing.

Option C: Write a custom Apex web service that, given an email address, does all of the logic the integration code was doing.

Option D: Create several Apex InboundEmailHandlers to accept calls from the third-party system, thus bypassing the API limits.

Answer(s): 3

Explanation: Not available

SEO Keywords: SEO keywords not available


16. A company wants to build a custom Lightning Component that will display a specified Account Field Set and that can only be added to the Account record page. Which design resource configuration should be used?

Page: Page 4

Option A: FieldSet

Option B: Account

Option C: FieldSet

Option D: Account

Answer(s): 2

Explanation: Not available

SEO Keywords: SEO keywords not available


17. A developer created a new trigger that inserts a Task when a new Lead is created. After deploying to production, an outside integration is periodically reporting errors. Which change should the developer make to ensure the integration is not affected with minimal impact to business logic?

Page: Page 5

Option A: Remove the Apex Class from the Integration User's Profile.

Answer(s):

Explanation: Not available

SEO Keywords: SEO keywords not available


18.

Page: Page 5

Answer(s):

Explanation: Not available

SEO Keywords: SEO keywords not available


19.

Page: Page 5

Answer(s):

Explanation: Not available

SEO Keywords: SEO keywords not available


20.

Page: Page 5

Answer(s):

Explanation: Not available

SEO Keywords: SEO keywords not available


21. global with sharing class MyRemoter { public String accountName { get; set; } public static Account account { get; set; } public AccountRemoter() {} @RemoteAction global static Account getAccount(String accountName) { account = [SELECT Id, Name, NumberOfEmployees FROM Account WHERE Name = :accountName]; return account; } } Consider the Apex class above that defines a RemoteAction used on a Visualforce search page. Which code snippet will assert that the remote action returned the correct Account?

Page: Page 6

Option A: Account a = controller.getAccount('TestAccount'); System.assertEquals( 'TestAccount', a.Name );

Option B: MyRemoter remote = new MyRemoter(); Account a = remote.getAccount('TestAccount'); System.assertEquals( 'TestAccount', a.Name );

Option C: MyRemoter remote = new MyRemoter('TestAccount'); Account a = remote.getAccount (); System.assertEquals( 'TestAccount', a.Name );

Option D: Account a = MyRemoter.getAccount('TestAccount'); System.assertEquals( 'TestAccount', a.Name );

Answer(s): 4

Explanation: Not available

SEO Keywords: SEO keywords not available


22. A custom Visualforce controller calls the ApexPages.addMessage() method, but no messages are rendering on the page. Which component should be added to the Visualforce page to display the message?

Page: Page 6

Option A:

Option B:

Option C:

Option D:

Answer(s): 4

Explanation: Not available

SEO Keywords: SEO keywords not available


23. A developer is writing code that requires making callouts to an external web service. Which scenario necessitates that the callout be made in an @future method?

Page: Page 6

Option A: The callouts will be made in an Apex Trigger.

Option B: The callouts will be made in an Apex Test class.

Option C: The callout could take longer than 60 seconds to complete.

Option D: Over 10 callouts will be made in a single transaction.

Answer(s): 1

Explanation: Not available

SEO Keywords: SEO keywords not available


24. A developer wants to call an Apex Server-side Controller from a Lightning Aura Component. What are two limitations to the data being returned by the Controller? (Choose two.)

Page: Page 6

Option A: A custom Apex Class can be returned, but only the values of public instance properties and methods annotated with @AuraEnabled are serialized and returned.

Option B: Lists of Custom Apex Classes cannot be returned by Apex Controllers called by Lightning Aura Components.

Option C: Basic data types are supported, but defaults, such as maximum size for a number, are defined by the objects that they map to.

Option D: Only Basic data types and sObjects are supported as return types for Apex Controllers called by Lightning Aura Components.

Answer(s): 1,3

Explanation: Not available

SEO Keywords: SEO keywords not available


25. Which interface needs to be implemented by a Lightning Component so that it may be displayed in modal dialog by clicking a button on a Lightning Record page?

Page: Page 7

Option A: force:lightningQuickAction

Option B: lightning:quickAction

Option C: lightning:editAction

Option D: force:lightningEditAction

Answer(s): 1

Explanation: Not available

SEO Keywords: SEO keywords not available


26. Sometimes events on Salesforce need to be handled by an external system due to the scale or type of process being executed. Consider the use case of a user in Salesforce needing to get pricing for an order they are building in Salesforce while on the phone with a customer. The pricing logic already exists in a third-party system. Instead of recreating this logic in Salesforce, it will be leveraged by making a request of the third-party system. The response, in this case the pricing, will be returned and stored back in Salesforce. What is the optimal solution?

Page: Page 7

Option A: A Visualforce page that can make a real-time Apex callout to display and save the pricing back in Salesforce

Option B: An Apex trigger that upon saving the Order will make a real-time Apex callout, saving the pricing back in Salesforce

Option C: A Process Builder process and Outbound Message to fetch the pricing upon save and store the pricing in Salesforce

Option D: An ETL tool to process batches of newly saved Orders every few minutes to store the pricing back in Salesforce

Answer(s): 1

Explanation: Not available

SEO Keywords: SEO keywords not available


27. What are three benefits of using declarative customizations over code? (Choose three.)

Page: Page 7

Option A: Declarative customizations cannot generate run time errors.

Option B: Declarative customizations will automatically update with each Salesforce release.

Option C: Declarative customizations do not require user testing.

Option D: Declarative customizations are not subject to governor limits.

Answer(s): 2,4,5

Explanation: Not available

SEO Keywords: SEO keywords not available


28. Which use case can only be performed by using asynchronous Apex?

Page: Page 7

Option A: Scheduling a batch process to complete in the future

Option B: Processing high volumes of records

Option C: Updating a record after the completion of an insert

Option D: Calling a web service from an Apex trigger

Answer(s): 4

Explanation: Not available

SEO Keywords: SEO keywords not available


29. @isTest static void testIncrement() { Account acct = new Account(Name = 'Test'); acct.Number_Of_Times_Viewed__c = 0; insert acct; AuditUtil.incrementViewed(acct.Id); Account acctAfter = [SELECT Number_Of_Times_Viewed__c FROM Account WHERE Id = :acct.Id][0] System.assertEquals(1, acctAfter.Number_Of_Times_Viewed__c); } The test method above calls an @future method that increments the Number_of_Times_Viewed c value. The assertion is failing because the Number_of_Times_Viewed c equals 0. What is the optimal way to fix this?

Page: Page 8

Answer(s):

Explanation: Not available

SEO Keywords: SEO keywords not available


30.

Page: Page 8

Answer(s):

Explanation: Not available

SEO Keywords: SEO keywords not available


0/Post a Comment/Comments

#Advertisement

Top Post Ad