Platform Dev II Flashcards
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
C. TypeOf
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
D. Flow.Interview
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(()=>{});
D.
~~~
afterEach(()=>{
while(document.body.firstChild){
document.body.removeChild(document.body.firstChild);
}
});
~~~
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
C. Execution Units
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
B. Use a future method that performs the SOAP callout and processes the response
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
B. AuraHandledException
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
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
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
B. Specific objects should be targeted to perform the search
C. Whenever possible, a search should not be performed in all the fields
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. Javascript remoting
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. Specific objects should be targeted to perform the search
C. Whenever possible, a search should not be performed on all the fields
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
C. Execute Search.query()
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>
C. <apex:actionSupport>
D. <apex:actionFunction></apex:actionFunction></apex:actionSupport>
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. 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>
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
B. Execution Units
For a test method, how does the method look for testing a method named ‘displaySettings’?
A. cmp.displaySettings();
B. cmp.invokeAction(‘displaySettings’);
A. cmp.displaySettings();