Font size
WorksheetsSF D1
Total questions: 60
Worksheet time: 1hrs 28mins
There
is a requirement to validate that the country code of an account field is a
valid ISO code. There are over 200 codes. What could be used for this
validation?
Before Update trigger on Account
Validation Rule
Formula Field
After Update trigger on Account
A requirement has been given to display the average value of won opportunities on the Account page layout. How can this be best achieved?
Use a trigger on the opportunity object
Use a trigger on the account object
Use roll-up summary fields and a formula field
Use a roll-up summary field with the average function
How can a developer check if the current user is able to delete the current object?
Use the isDeletable() method of the DescribeSObjectResult Class
Use the canDelete() method of the DescribeSObjectResult Class
Use the Deletable() method of the SObjectResult Class
Use the canDelete() method of the SObjectResult Class
An organization has enabled Multiple Currencies. A developer needs to calculate the total of the Estimated_value__c on CampaignMember object using a roll-up summary field on Campaign object named Total_estimated_value__c. What will be the currency of the Total_estimated_value__c field?
The field values in Estimated_value__c from CampaignMember object are converted into the currency of the current user, and the Total_estimated_value__c is shown using the currency of the current user on the Campaign.
The field values in Estimated_value__c from CampaignMember object are summed up, and the Total_estimated_value__c field is shown as a Number field on the Campaign.
The field values in Estimated_value__c are converted into the currency of the majority of the CampaignMember records, and the Total_estimated_value__c is shown using that currency.
The field values in Estimated_value__c from CampaignMember object are converted into the currency of the Campaign, and the Total_estimated_value__c is shown using the currency of the Campaign.
String
is one of the primitive data types in Salesforce. Given the following
options, what is a valid value that a string data type variable can
contain?
‘Salesforce’
3.14159
TRUE
"Salesforce"
The following code snippet fails during bulk data load. What is the root cause?
No update DML over list of Contacts
SOQL query is located inside the for loop code.
Condition is invalid and will always be null.
Variable 'con' is not declared.
A developer can develop code to insert records that will allow successful inserts and will record errors for unsuccessful records. This is called partial processing. However, this method will not throw an exception. How should a developer handle the possible exceptions?
Use Database.EachResult Class
Use Database.SuccessResult Class
Use Database.SaveResult Class
Use Database.ErrorResult Class
Which
of the following are valid Apex data types?
Choose 3 answers.
Currency
Text
ID
Enum
Blob
What is the order of execution when a record is saved?
System Validation Rules, Workflow Rules, All Validation Rules, Before Triggers, After Triggers, Assignment Rules, Commit
System Validation Rules, Before Triggers, All Validation Rules, Duplicate Rules, After Triggers, Assignment Rules, Workflow Rules, Commit
System Validation Rules, Before Triggers, All Validation Rules, Workflow Rules, After Triggers, Assignment Rules, Commit
System Validation Rules, User Defined Validation Rules, Before Triggers, Workflow Rules, After Triggers, Workflow Rules, Assignment Rules, Commit
Which of these methods are valid ways to initialize a list? Choose 3 answers
List<Account> accList = new Account[]{};
List<Account> new = ‘accList’;
Account[] accList = new Account[]{};
List<Account> accList = new List<Account>();
If a developer needs to skip to the next iteration of a loop, what loop control structure should be used?
continue;
end;
break;
skip;
What will be the result of an unhandled exception on any DML statements?
A savepoint will be generated
There is no impact on DML statements
DML statements will be saved up to the exception point
DML statements will be rolled back
Which of the following statements are true about using a SOQL for loop to process records in Apex code?
Choose 2 answers.
SOQL for loop can be used to avoid the limit on heap size
SOQL for loop can only be used to execute code once per sObject record
Using a SOQL for loop, it is possible to perform a DML operation on a list of sObjects at a time
A SOQL for loop can process records in batches of 500
An assignment statement is any statement that places a value into a variable. Which one of the following expressions is a valid Apex assignment statement?
String a = new String(‘sampleString’);
Map<Id, Account> = [SELECT Id, Name FROM Account];
Account acc = new Account();
List<Contact> conList = new [SELECT Id FROM Contact];
Apex and Visualforce pages are prone to data access control issues. Which approach helps address these issues?
Use the [with sharing] keyword in Apex classes
Use the [without sharing] keyword in Apex classes
Use the [shareable] keyword in Apex classes
Use the [non shareable] keyword in Apex classes
How can a developer query a multi-select picklist?
Choose 2 answers.
Semicolon and comma characters can be used to add filters for the multi-select picklist field to the SOQL query
Picklist values can be specified with AND / OR logic
Picklist values can only be specified with AND logic
Picklist values can only be specified with OR logic
Which of the following are true regarding custom setting data? Choose 2 answers.
Custom setting data can be accessed by formula fields, validation rules, Apex and Visualforce pages
Custom setting data cannot be queried using SOQL
Custom setting data needs to be queried once using SOQL and then it is stored in the cache
There are two types of custom setting data, hierarchy and list
What are some of the limitations of changing the data type of a custom field?
Choose 3 answers.
Developers cannot change the data type of a custom field if it is referenced in Apex.
Developers cannot change the data type of a custom field that is referenced by a Visualforce page.
The file field type in Salesforce Knowledge can be changed as long as it is not referenced in a Apex Class.
The option to change the data type of a custom field is not available for all data types.
A developer would like to display a Visualforce page from a custom button on the Account page layout. Which of the following is true in regards to this?
Choose 2 answers.
Custom Buttons can only be used with custom objects
Custom Buttons can only be added to custom page layouts
Custom Buttons will work with standard or custom objects
Custom Buttons can be added to standard page layouts
What is the preferred way to reference web content – such as images, stylesheets, JavaScript, and other libraries, that is used in Visualforce pages?
By accessing the content from Chatter files
By uploading the content as a Static Resource
By uploading the content to the documents tab
By accessing the content from a third-party CDN
A VisualForce page uses a custom Apex controller class. An ID parameter value was passed to the URL. How can a developer retrieve the record using this value?
Use ApexPages.currentPage().getAnchor() to get the parameter value then make a query to the record using the ID in the controller's constructor.
Use ApexPages.currentPage().getHeaders() to get the parameter value then make a query to the record using the ID in the controller's constructor.
Use ApexPages.currentPage().getParameters() to get the parameter value then make a query to the record using the ID in the controller's constructor.
Use ApexPages.currentPage().getContent() to get the parameter value then make a query to the record using the ID in the controller's constructor.
Which iteration components can be used to display a table of data in a Visualforce page?
Choose 2 answers.
<apex:outputTable>
<apex:pageBlockTable>
<apex:dataTable>
<apex:table>
What is true regarding the View State in a Visualforce Page?
There is no limit to the size of the view state
The view state is used to store the layout of a Visualforce page
The view state is used to store state across multiple pages, such as in a wizard
The view state is used to store state across multiple user sessions
A developer is required to embed a website into a Visualforce page. What Visualforce component can the developer use?
<apex:output>
<apex:getsite>
<apex:include>
<apex:iframe>
Support agents of Cosmic Service Solutions use a custom console app in Lightning Experience to manage multiple records on a single screen. A developer has created a Visualforce page that allows users to input data related to cases. Which of the following actions are supported for overriding with the Visualforce code in the console app?
Choose 2 answers.
Delete
View
Edit
Create
What are the ways a developer can include Javascript in a Visualforce page?
Choose 2 answers.
<script>
<apex:includeScript>
<javascript>
<apex:js>
Which of the following best describe the Lightning Component framework? Choose 2 answers.
It uses ODS as its data format
It has an event-driven architecture
It automatically upgrades all pre-existing Visualforce pages and components
It is device-aware and supports cross-browser compatibility
A team of developers would like to create a commercially available Force.com app. In this case, which environments would be used?
Choose 2 answers.
A Developer Edition
A Partial Copy Sandbox
A Developer Pro Sandbox
A Partner Developer Edition
Sending and receiving change sets can be done between which of the following?
Choose 2 answers.
Developer Edition to Developer Edition
Developer Edition to Production.
Developer Sandbox to Production.
Sandbox to Sandbox.
Before deploying to production, what is true?
Choose 3 answers.
Testing cannot be completed in a developer edition
APEX Code must have sufficient code coverage
Development must be done in a developer edition or sandbox
It is a best practice to test in a dedicated testing environment with large sets of data
When test data cannot be created programmatically, how can pre-existing data be accessed?
Annotate the test class or method with [seeAllData=false]
Annotate the test class or method with [seeAllData=true]
Annotate the test method with [withSharing=false]
Annotate the test method with [withSharing=true]
A developer has found that test data creation is duplicated across test classes. How can this be eliminated?
Creating common test utility classes
De-annotating @isTest on methods
Using one common test class
Making the test methods Public
What static methods are used when testing governor limits, executing test scenarios with a larger data set or if creating an additional set of governor limits during the execution of a single test class is necessary?
Test.isTest() and Test.isnotTest()
Test.runAs() and Test.getLimits()
Test.startTest() and Test.stopTest()
Test.setFixedSearchResults()
Test methods don’t have access by default to pre-existing data in the organization except for which of the following?
Choose 3 answers.
Custom Setting data
Profiles
Custom Objects
Users
Record Types
Which of the following is a best practice when writing test classes?
Use SeeAllData=true.
Use System.debug() method to verify test results.
Use @future annotation.
Use System.assert() methods to verify test results.
You need to deploy an Apex class and test class to a production org but only have limited time. You decide to run selected tests. Which of the following are true about running selected tests?
Choose 2 answers.
Individual test methods can also be specified.
Running selected or specified tests is only available in Metadata API.
If the code coverage of an Apex component in the deployment is less than 75%, the deployment fails.
Code coverage is computed for each class and trigger individually and is different than the overall coverage percentage.
A developer is selecting and running the same set of test classes repeatedly. What feature can help with making this task more efficient?
Defining a test suite
Defining a test set
Defining a master test class
Reducing the number of test classes
What are valid use cases for the AppExchange?
Choose 2 answers.
To exchange apps with other developers
To exchange ideas and tips with other developers
To extend standard Salesforce functionality
To add industry specific functionality to Salesforce
Record types have been defined on the Account object. What does this mean?
Choose 2 answers.
Different page layouts can be assigned for each record type
Different picklist values can be defined for each record type
Different fields can be defined for each record type
Different users can be assigned to each record type
Which of the following are true regarding developing in the Salesforce multi-tenant environment?
Choose 2 answers.
Salesforce delivers polyglot persistence transparently
It is not possible to index application data as each tenant stores different types of data in the same application table
Queries need to be selective in terms of the number of records returned
The custom domain feature ensures that different customers do not access each other's data
What is true regarding Person Accounts?
Choose 3 answers.
Person Accounts have the same fields as a business account
Person Accounts do not have an account hierarchy
Once Person Accounts are enabled they cannot be disabled
If Person Accounts are enabled, when creating an account, the type of account to create needs to be selected
How can the relationship between different accounts be recorded and viewed?
Choose 2 answers.
Using the Related Account field
Using the Parent Account field
Using the View Hierarchy link
Using the Generate Relationship function
Which of the following are valid Apex variables?
Choose 3 answers.
Number x;
Currency abc;
Boolean y;
Map<ID, String> sampleMap;
String a,b,c;
A developer needs to get the Contact records with a last name that starts with ‘Ab’. What code in the options below will satisfy his requirements?
SELECT Id, LastName FROM Contact WHERE LastName LIKE ‘Ab_’
SELECT Id, LastName FROM Contact WHERE LastName := ‘Ab%’
SELECT Id, LastName FROM Contact WHERE LastName IN (‘Ab’)
SELECT Id, LastName FROM Contact WHERE LastName LIKE ‘Ab%’
Which data type is appropriate for a numerical value of 726.234 stored in the variable totalCost?
Integer totalCost;
Decimal totalCost;
Numeric totalCost;
Long totalCost;
Which of the following field types can a Roll-Up Summary field calculate?
Picklist
Checkbox
Text
Number
How can a dynamic SOQL query be created at runtime using input from an end user?
Use the SOQL.execute(string) with a query specified in the string
Use the Database.search(string) with a query specified in the string
Use the Database.execute(string) with a query specified in the string
Use the Database.query(string) with a query specified in the string
What method can be used to obtain metadata information about all the sObjects in an organization and their fields?
describeObjects()
getGlobalSObjects()
getGlobalDescribe()
describeSObjects()
What is the discretionary clause that can be added to a SOSL query to specify the information to be returned in the text search result?
ORDER by
OFFSET n
RETURNING
LIMIT n
A developer is considering writing a trigger to perform data validation before saving a record. What other options can be used for data quality checks?
Choose 3 answers.
Picklists
Required fields
Escalation rules
Validation rules
Which of the following code snippets are acceptable to be included within a looping statement?
Choose 2 answers.
insert accountList;
System.debug(‘The following account has been updated’ + ‘acc.Id ‘);
if(acc.NumberOfEmployees > 5000){
Opportunity getOpp = [SELECT Id, AccountId FROM Opportunity WHERE AccountId =: acc.Id];
What will be the result of running the following code?
A limit exception will be caught and one account will be inserted
150 accounts will be inserted
No accounts will be inserted
201 accounts will be inserted
A developer is required to override the standard Opportunity view button using a Visualforce page. What should the developer do?
Use a controller extension
Use the Opportunity StandardController
Use a custom controller and replicate the opportunity detail page
Use the StandardListController
The following code snippet fails during bulk data load. What is the root cause?
No update DML over list of Contacts
SOQL query is located inside the for loop code.
Condition is invalid and will always be null.
Variable 'con' is not declared.
A developer is required to access Opportunity records on a Visualforce page without using a custom controller. How can the developer satisfy this requirement?
<apex:page controller="Opportunity" recordListVar="opportunities">
<apex:page controller="Opportunity" recordSetVar="opportunities">
<apex:page standardController="Opportunity" recordSetVar="opportunities">
<apex:page standardController="Opportunity" getAllRecordsVar="opportunities">
A developer has written the following code to do a SOSL search: FIND {New York}. What will be returned?
A map of sObjects that match the search term
A list of Contacts that match the search term
A list of lists of sObjects and their records that match the search term
A map of Accounts or Contacts that match the search term
What will happen if a governor limit is hit from an Apex class that was called from an Apex controller class of a VisualForce page? Choose 2 answers.
An exception will be thrown.
It will save all changes made from the Apex controller class.
It will save all changes made from the Apex class.
It will rollback all changes made up to the error.
When catching exceptions, the default notification actions in uncaught exceptions will be lost, so developers are expected to formulate their own. Which of the following ways can a developer notify the user of the issue?
Choose 2 answers.
Using .addError method on errors that may occur in DML on Apex Triggers.
Sending an email that may add to the catch-block of a try-catch construct
Adding a @future method to create a record on a custom object that could catch the error details.
Using ApexPages.message class to create an error message for display on a Visualforce page.
The Salesforce Administrator is building an application and needs to create a master detail relationship between the standard object Account and a custom object. What is true regarding the relationship?
Choose 2 answers.
The custom object can be on the master or detail side of the relationship
The standard object can be on the master or detail side of the relationship
The standard object is always the master
The object on the detail side will inherit the security and sharing settings of the master object
Your company has a requirement to track the vehicles assigned to work orders. Vehicles can exist without Work Orders and have a record owner. What kind of relationship should be created between Work Orders and Vehicles?
Hierarchy
Picklist
Lookup
Master Detail
