Questions Flashcards
When should developers use the “with sharing” keyword in Apex classes?
A When they want to bypass sharing rules for the current user
B When they want to enforce CRUD access
C When they want to specify inhereted sharing for the current user
D when they want to determine execution context and enforce permissions, field-level security, and sharing rules
Apex
D
What does the “without sharing” keyword do in the context of Apex classes?
A Enforces sharing rules for current user
B Bypasses sharing rules for current user
C Specifies inherited sharing for current user
D Enforces CRUD access
Apex
B
How can SOQL injection occur in a Salesforce application?
A By Executing DML Operation
B By using WITH SECURITY_ENFORCED clause in SOQL
C By trusting user input and incorectly halndling it in SOQL
D By Chaning multiple queries together
C
What technique is recommended to prevent SOQL injection attacks when using dynamic queries?
A Static queries with bind variables
B Replacing characters in the user input
C Escaping single quotes using string.escapeSingleQuotes()
D Implementing allowlisting for user input
SOQL
A
How can developers prevent CSRF attacks in their Salesforce Lightning applications?
A By avoiding use of POST and PUT requests
B By relying solely on default Salesforce CSRF tokens
C By usingHTTP GET requests with state changing parameter
D By validation origin header and inmplemeting anti-CSRF tokens
D
When is a Lightning page vulnerable to CSRF?
A When it uses of POST and PUT requests
B When server-side DML operations are executed automatically on page-loading events
C When it doesn’t include anti-CSRF tokens in XMLHttpRequests
D When it doesn’t implement allowlisting for Lightning components
B
How can developers prevent SSRF attacks in Salesforce Lightning applications?
A By avoiding state-changing POST and PUT requests
B Allowing unrestricted access to Internal resources
C Ignoring input validations for user provided values
D Allowlisting permitted URLs for outgoing requests
D
Which two use cases require a partial copy or full sandbox?
Choose two answers
A. Scalability Testing
B. Development Testing
C. Quality Assurance Testing
D. Batch Data Testing
A. Scalability Testing
D. Batch Data Testing
In the Lightning Component framework, where is client-side controller logic contained?
Choose one answer
A. Apex
B. Visualforce
C. HTML
D. JavaScript
D. JavaScript
A developer creates a method in an Apex class and needs to ensure that errors are
handled properly. Which three should the developer use?
Choose three answers
A. ApexPages.addErrorMessage()
B. A custom exception
C. .addError()
D. Database.handleException()
E. A try/catch construct
B. A custom exception
C. .addError()
E. A try/catch construct
Which two are valid in the where clause of a SOQL query?
Choose two answers
A. A geolocation field
B. An encrypted field
C. An aggregate function
D. An alias notation
A. A geolocation field
D. An alias notation
What is the correct way to describe how Model-View-Controller (MVC) architecture is
implemented on the Salesforce platform?
Choose one answer
A. Model: Standard and Custom Objects; View: Visualforce Pages; Controller: sControls
B. Model: Schema Builder; View: List Views; Controller: Setup Console
C. Model: Standard and Custom Objects; View: Visualforce Pages; Controller: Apex
Code
D. Model: Apex Code; View: List Views; Controller: Setup Console
C. Model: Standard and Custom Objects; View: Visualforce Pages; Controller: Apex
Code
In which of the following environments can Developers write code? Select all that apply.
Developer edition production org
Enterprise edition production org
Enterprise edition Sandbox org
Professional edition Sandbox org
How can a developer avoid exceeding Governor Limits when using an Apex Trigger? Select all that apply.
By using a helper class that can be invoked from multiple triggers
By using Maps to hold data from query results
By using the Database class to handle DML transactions
By performing DML transactions on lists of Objects
Which of these is an accurate statement about “with sharing” keywords? Select all that apply.
Inner classes inherit the sharing setting from the container class
Either inner classes or outer classes can be declared as “with sharing”, but not both
Inner classes do not inherit the sharing setting from the container class
Both inner classes and outer classes can be declared as “with sharing”
Which standard field mandatorily needs to be populated when a developer inserts new Contact records programmatically?
Name
LastName
AccountId
FirstName
In the given code, from where does the Boolean inherit its value? _x000D_Boolean b = true;
Class
Object
Enum
String
Which of these is a characteristic of the Lightning Component framework? Select all that apply.
It has an event-driven architecture.
It works with the existing Visualforce pages.
It uses XML as its data format.
It includes responsive components.
Visualforce components are similar to which type of tag library containing tag namespace prefixes?
ASP tag library
JSP tag library
ASP log file
DL JSP log file
A developer wants to display all of the available record types for a Case object. The developer also wants to display the picklist values for the Case.Status field. The Case object and the Case.Status field are on a custom Visualforce page. What action can the developer perform to get the record types and picklist values in the controller? Select all that apply.
Use Schema.PickListEntry returned by Case.Status.getDescribe().getPicklistValues()
Use Schema.RecordTypeInfo returned by Case.SObjectType.GetDescribe().getRecordTypeInfos()
Use SOQL to query Case records in the org to get all the RecordType values available for Case
Use SOQL to query case records in the org to get all values for the Status picklist field
On a Visualforce page with a custom controller, by using an ID parameter that is passed in the URL, how should a developer retrieve a record? Select all that apply.
Use the constructor method for the controller
Use the $Action.View method in the Visualforce page
Use the <apex:detail> tag in the Visualforce page
Create a new PageReference object with the Id</apex:detail>
A Visualforce page has a standard controller for an object that has a lookup relationship to a parent object. How can a developer display data from the parent record on the page?
By adding a second standard controller to the page for the parent record
By using a roll-up summary field on the child record to include data from the parent record
By using SOQL on the Visualforce page to query for data from the parent record
By using merge field syntax to retrieve data from the parent record
What is the preferred way to reference web content such as images, stylesheets, JavaScript, and other libraries that is used in Visualforce pages?
Uploading the content as a Static Resource
Accessing the content from a third-party CDN
Uploading the content in the Documents tab
Accessing the content from Chatter Files
The Review__c object has a lookup relationship with the Job_Application__c object. The Job_Application__c object has a master-detail relationship with the Position__c object. The relationship field names are based on the auto-populated defaults. What is the recommended way to display field data from the related Review__c records on a Visualforce page for a single Position__c record?
A Utilize the Standard Controller for Position__c and expression syntax in the Page to display related Review__c data through the Job_Application__c object
B Utilize the Standard Controller for Position__c and cross-object Formula Fields on the Job_Application__c object to display Review__c data
C Utilize the Standard Controller for Position__c and cross-object Formula Fields on the Review__c object to display Review__c data
D Utilize the Standard Controller for Position__c and a Controller Extension to query for Review__c data