ExamGecko
Home Home / Salesforce / Certified Platform Developer II

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

Question list
Search
Search

List of questions

Search

Related questions











Which annotation should a developer use on an Apex method to make it available to be wired to a property In a Lightning web component?

A.
@RemoteAction
A.
@RemoteAction
Answers
B.
@AuraEnabledcacheable=true)
B.
@AuraEnabledcacheable=true)
Answers
C.
@QRemoteAction(caccheable=true)
C.
@QRemoteAction(caccheable=true)
Answers
D.
@AuraEnabled
D.
@AuraEnabled
Answers
Suggested answer: B

Users upload .csv files in an external system to create account and contact records in Salesforce. Up to 200 records can be created at a time. The users need to wait for a response from Salesforce in the external system, but the data does not need to synchronize between the two systems.

Based on these requirements, which method should a developer use to create the records in Salesforce?

A.
REST API request using composite/vbatch/
A.
REST API request using composite/vbatch/
Answers
B.
REST API request using composite/tree/
B.
REST API request using composite/tree/
Answers
C.
Apex web services
C.
Apex web services
Answers
D.
Bulk API 2.0
D.
Bulk API 2.0
Answers
Suggested answer: D

Consider the following code snippet:

Choose 2 answers

A.
import getOrders from ,@salesforce/apex/OrderController.getAvailableOrders';
A.
import getOrders from ,@salesforce/apex/OrderController.getAvailableOrders';
Answers
B.
import ( LightningElement—apt ) from 'lwc*.-
B.
import ( LightningElement—apt ) from 'lwc*.-
Answers
C.
import getOrders from @salesforc/apex/c.OrderController.getAvailablOrd#r»';
C.
import getOrders from @salesforc/apex/c.OrderController.getAvailablOrd#r»';
Answers
D.
import { LightningElement, wire ) from 'lwc';
D.
import { LightningElement, wire ) from 'lwc';
Answers
Suggested answer: A, D

A business currently has a process to manually upload orders from its external Order Management System (OMS) into Salesforce.

This is a labor intensive process since accounts must be exported out of Salesforce to get the IDs. The upload file must be updated with the correct account IDs to relate the orders to the corresponding accounts.

Which two recommendations should make this process more efficient?

Choose 2 answers

A.
Ensure the data in the file is sorted by the order ID.
A.
Ensure the data in the file is sorted by the order ID.
Answers
B.
Use the upsert wizard in the Data Loader to import the data.
B.
Use the upsert wizard in the Data Loader to import the data.
Answers
C.
Identify unique fields on Order and Account and set them as External IDs.
C.
Identify unique fields on Order and Account and set them as External IDs.
Answers
D.
Use the Insert wizard In the Data Loader to Import the data.
D.
Use the Insert wizard In the Data Loader to Import the data.
Answers
Suggested answer: B, C

A developer wrote an Apex method that makes an HTTP callout to an external system to getspecialized data when a button is clicked from a custom Lightning web component on the Accountrecord page.

Recently, users have complained that it takes longer than desired for the data to appear on the page after clicking the button.

What should the developer use to troubleshoot this issue?

A.
Lightning Inspector
A.
Lightning Inspector
Answers
B.
Devdoper Console
B.
Devdoper Console
Answers
C.
Salesforce CU
C.
Salesforce CU
Answers
D.
Event Logs
D.
Event Logs
Answers
Suggested answer: C

Which two best practices should the developer Implement to optimize this code?

Choose 2 answers

A.
Use a collection for the DML statement.
A.
Use a collection for the DML statement.
Answers
B.
Query the Pricing_structure__c records outside of the loop.
B.
Query the Pricing_structure__c records outside of the loop.
Answers
C.
Change the trigger context to after update, after insert.
C.
Change the trigger context to after update, after insert.
Answers
D.
Remove the DML statement.
D.
Remove the DML statement.
Answers
Suggested answer: B, D

A developer is creating a Lightning web component that displays a list of records in a lightning-datatable. After saving a new record to the database, the list is not updating.

What should the developer change in the code above for this to happen?

A.
Add the @track decorator to the data variable.
A.
Add the @track decorator to the data variable.
Answers
B.
Create a new variable to store the result and annotate it with @tracx.
B.
Create a new variable to store the result and annotate it with @tracx.
Answers
C.
Call refereshApex () on this.data
C.
Call refereshApex () on this.data
Answers
D.
Create a variable to store the result and call refreshApex ().
D.
Create a variable to store the result and call refreshApex ().
Answers
Suggested answer: D

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

What is the most efficient way to Implement this?

A.
Set a cookie in the browser for use upon return to the page.
A.
Set a cookie in the browser for use upon return to the page.
Answers
B.
Decorate the server-side method with @AuraEnabled(storagele=true).
B.
Decorate the server-side method with @AuraEnabled(storagele=true).
Answers
C.
Decorate the server-side method with @AuraEnabled(caccheable-true).
C.
Decorate the server-side method with @AuraEnabled(caccheable-true).
Answers
D.
Call the setstoreable () method on the action in the JavaScript client-side code.
D.
Call the setstoreable () method on the action in the JavaScript client-side code.
Answers
Suggested answer: C

A developer wrote the following method to find all the test accounts in the org:

What should be used to fix this falling test?

A.
Test. loaddata to set up expected data
A.
Test. loaddata to set up expected data
Answers
B.
Test. fixedSearchResults ( ) method to set up expected data
B.
Test. fixedSearchResults ( ) method to set up expected data
Answers
C.
@isTest (See AllData=true) to access org data for the test
C.
@isTest (See AllData=true) to access org data for the test
Answers
D.
@testSetup method to set up expected data
D.
@testSetup method to set up expected data
Answers
Suggested answer: B

Consider the following code snippet:

Which two steps should the developer take to add flexibility to change the endpolnt and credentials without needing to modify code?

Choose 2 answers

A.
Create a Named Credential, endPoint_NC, to store the endpoint and credentials.
A.
Create a Named Credential, endPoint_NC, to store the endpoint and credentials.
Answers
B.
Store the URL of the endpoint in a custom Label named endPointURL.
B.
Store the URL of the endpoint in a custom Label named endPointURL.
Answers
C.
Use req.setEndpoint(,callcut:endPoint_NC,); within the callout request.
C.
Use req.setEndpoint(,callcut:endPoint_NC,); within the callout request.
Answers
D.
Use req.setEndpoint(Label.endPointURL);.
D.
Use req.setEndpoint(Label.endPointURL);.
Answers
Suggested answer: A, C
Total 408 questions
Go to page: of 41