Platform Dev II Flashcards

1
Q

A SOQL query in an Apex Controller is supposed to return up to 50 task records to the Aura component. Depending on the SObject type for the “What” field, different fields need to be returned by the query. Which SOQL keyword should be utilized?

A. WhenType
B. GetType
C. TypeOf
D. SObjectType

A

C. TypeOf

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

A Developer wants to check the functionality of a flow using Execute Anonymous. Which can be used to run the flow?

A. FlowContainer
B. Flow element
C. Flow trigger
D. Flow.interview

A

D. Flow.Interview

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Which method should this code snippet be enclosed in, to help ensure through Jest tests that the DOM is reset at the end of each test?

while(document.body.firstChild){
 document.body.removeChild(document.body.firstChild);
}

A. clear(() => {});
B. reset(() => {});
C. afterTest(() =>{});
D. afterEach(()=>{});

A

D.
~~~
afterEach(()=>{
while(document.body.firstChild){
document.body.removeChild(document.body.firstChild);
}
});
~~~

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

A developer needs to know how many rows were returned by a SOQL query via APEX code. Which of the following could be used to get a quick overview of this information?

A. Execution Tree
B. Execution Log
C. Execution Units
D. Execution Stack

A

C. Execution Units

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

A developer has created a visualforce page that makes a SOAP callout on the click of a button. If the external system requires substantial time to process this request, and users shouldn’t need to wait for a response, which of the following should a developer do to meet this requirement?

A. Use a controller extension to make an asynchronous callout from the page
B. Use a future method that performs the SOAP callout and processes the response
C. Use the @RemoteAction annotation in the custom controller of the page to make the callout
D.Use the Continuation class in the controller class to make a long-running callout

A

B. Use a future method that performs the SOAP callout and processes the response

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Which of the following exceptions can be gracefully handled by Lightning and allow a developer to customize the displayed message?

A. LightningHandledException
B. AuraHandledException
C. AuraException
D. LightningException

A

B. AuraHandledException

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

If a Lightning Component is to be used by all users, but that a field’s profile based access is to be respected, what type of option could be used to show this sensitive field information to its users?

A. WITH SHARING keyword in the Apex Class
B. With SECURITY_ENFORCED clause in the SOQL query in the apex class
C. Use the “stripInaccessible” method to strip the field from the SOQL query

A

C. Use the “stripInaccessible” method to strip the field from the SOQL query

Option B would cause an exception to be thrown

Option A would only impact sharing rules and not field level security

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

A developer would like to use SOSL in custom Visualforce pages that allow users to filter and search for records of certain standard and custom objects. Since these objects contain millions of records, the developer is concerned about the performance of SOSL queries, and needs to optimize the performance before making the Visualforce page available to users.

Choose 2 answers

A. If applicable, records within a specific record types should be targeted.
B. Specific objects should be targeted to perform the search
C. Whenever possible, a search should not be performed in all the fields
D. Records owned by the searcher should be excluded

A

B. Specific objects should be targeted to perform the search
C. Whenever possible, a search should not be performed in all the fields

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

A developer is building a Visualforce page wherein a third party javascript library will be used to manipulate an HTML table. The plan is to load the table with client projects and include pagination, filters, search, and other features that require complex server-side logic. Users must be able to request the data asynchronously for the best user experience. Which is the most suitable option for this requirement?

A. Javascript remoting
B. Salesforce REST API
C. Remote Objects
D. Action Methods

A

A. Javascript remoting

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

A Salesforce Developer would like to utilize SOSL in custom Visualforce pages that allow users to filter and search for records of certain standard and custom objects. Since these objects contain millions of records, the developer is concerned about performance of SOSL queries and needs to optimize their performance before making the visualforce pages available to users. Which of the following are valid recommendations to optimize the performance?

A. Specific objects should be targeted to perform the search
B. If applicable, records within a specific record type should be targeted
C. Whenever possible, a search should not be performed on all the fields
D. Records owned by the searcher should be excluded

A

A. Specific objects should be targeted to perform the search

C. Whenever possible, a search should not be performed on all the fields

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

A custom search feature is being developed by a company. When the user enters a search term, the feature needs to search for that term in three custom objects that are used in the tool. Search filters must also be available to help narrow down the search results when necessary. What should a developer do to obtain the necessary search results?

A. Execute a static SOSL query
B. Execute Database.query()
C. Execute Search.query()
D. Execute a static SOQL query

A

C. Execute Search.query()

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

A company would like to view a list of tile types in Visualforce. When an item is selected on the list, an embedded image on the page should automatically refresh to display the sample image of the product. Which of the following visualforce components can be used for this requirement?

Choose 2 answers

A. <apex:actionImage>
B. <apex:actionPoller>
C. <apex:actionSupport>
D. <apex:actionFunction></apex:actionFunction></apex:actionSupport></apex:actionPoller></apex:actionImage>

A

C. <apex:actionSupport>
D. <apex:actionFunction></apex:actionFunction></apex:actionSupport>

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

A developer is required to export metadata from an org. Which is true about the package.xml file that can be retrieved using retrieve()?

A. The <types> element contains the metadata type and members to be retrieved or deployed
B. The metadata type is defined using <name>
C. Individual components of a particular type are defined using <member>
D. It is possible to retrieve all components of a metadata type using <members>$</members>
E. The package.xml defines the components that need to be retrieved or deployed</member></name></types>

A

A. The <types> element contains the metadata type and members to be retrieved or deployed
B. The metadata type is defined using <name>
E. The package.xml defines the components that need to be retrieved or deployed</name></types>

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

A developer needs to know how many rows were returned by a SOQL query in Apex code. Which of the following could be used to get that information?

A. Execution Stack
B. Execution Units
C. Execution Log
D. Execution Tree

A

B. Execution Units

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

For a test method, how does the method look for testing a method named ‘displaySettings’?

A. cmp.displaySettings();

B. cmp.invokeAction(‘displaySettings’);

A

A. cmp.displaySettings();

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

Which of the following scenarios require a Lightning Web Component to call an apex method imperatively?

A. When the Apex method interacts with the Task object
B. When the Apex method contains a callback to an external system
C. When the method is not annotated with cacheable=true
D. When the method is not annotated with @AuraEnabled

A

A. When the Apex method interacts with the Task object

C. When the method is not annotated with cacheable=true

Imperatively = not using @wire (and cacheable=true), both Task and Event must be called imperatively. Use the imperative way when you need complete control over the javascript timing. Also use it when methods need to call Javascript ES6 modules that do not extend the LightningElement class.

17
Q

A developer wants a Visualforce page to call a controller method named “initPage” when the page first loads. What is the proper way to write this code?

A. <apex:page>
B. <apex:page>
C. <apex:page>
D. <apex:page></apex:page></apex:page></apex:page></apex:page>

A

D. <apex:page></apex:page>

18
Q

43: developer console stuff

A
19
Q
A
20
Q
A