Dev1 Cer
Dev1 Cer
Apex?
List<Database.SoslResult> soslResults = [FIND ‘SearchTerm’ IN ALL FIELDS RETURNING Account, Contact];
Map<Schema.SObjectType, List<SObject>> soslResults = [FIND ‘SearchTerm’ IN ALL FIELDS RETURNING Account, Contact];
Map<String, List<SObject>> soslResults = [FIND ‘SearchTerm’ IN ALL FIELDS RETURNING Account, Contact];
List<List<SObject>> soslResults = [FIND ‘SearchTerm’ IN ALL FIELDS RETURNING Account, Contact];
4- You have been tasked with writing a utility class which can be called from multiple
contexts, for example while running as an Experience User and an internal user
who should see all records. Which sharing declaration should be used in your
class to facilitate this?
With sharing
Inherited sharing
None
Implicit sharing
Without sharing
5- Which of the following code snippets correctly defines a new custom exception?
public exception MyCustomException{}
public class MyCustomException extends Exception{}
public class MyCustomExceptionClass extends Exception{}
public class MyCustomException implements Exception{}
7- How can we best reference external resources (e.g. CSS or JavaScript) within
Lightning Components and Visualforce pages?
Upload the resources to a CDN and reference them via link tags within our markup
Upload them as External Resources
Add links to our markup pointing to the external resources
Upload them as Static Resources
8- A custom field on Opportunity is assigned the number data type, with 18 digits
and 0 decimal places. Which primitive data type would this be assigned in Apex?
Decimal
Integer
Double
Long
10- Which of the following isn’t true about Visualforce standard controllers?
Field level and object level security is enforced by built in actions
They can be extended to provide customised logic
Controllers can either be tied to a single record, or a collection of records
Standard controllers only exist for custom objects
12-There are two before save triggers defined for the Contact object, which one of
them runs first?
The trigger which was created first
The order is random
Both execute together
The trigger which was created last
No
14- How can a developer execute an anonymous block of Apex code? (Choose 3)
Use the “Execute Anonymous” functionality within the Setup area
Use the Salesforce CLI “force:apex:execute” command
Utilise the REST API “executeAnonymous” endpoint
Use the Salesforce CLI “force:apex:execute:anonymous” command
Write a class with the @Anonymous annotation
Use the “Execute Anonymous” functionality of the Developer Console
15- A developer has an @AuraEnabled method that is frequently used in several
Lightning Web Components. It performs some complex calculations based on
data stored within custom metadata. Unless these values change, this method will
always return the same result. How can the developer improve the runtime
performance of Lightning Components utilising this method?
Before calling the apex method in the LWC, call “.setStorable()” on it
Use the Platform Cache to store the computed value
Create an ECMAScript Module component to manage calling and caching the response
Modify the method to be @AuraEnabled(cacheable=true)
16-A developer wishes to streamline the setting up of data for their test class. How
could this be achieved? (Choose 2)
Create a class specifically to create data for test methods
Utilise the @isTest(SeeAllData=true) annotation
Use the @isTest(isParallel=true) annotation
Add a @TestSetup annotated method to the class
19-A custom field was added to Opportunity which has become redundant due to
new business processes. What must be done before deleting the field?
Schedule the field for deletion via the API
Remove all field values on all Opportunity records
Remove all references to the field within the org
Set the Field Usage value on the field to DeprecateCandidate
3
1
4
2
23-You are tasked with creating a Lightning Component which will allow a user to
search public records of an object by filtering multiple field values. What can be
done to ensure this component can be securely used?
All of the above
Add the “WITH SECURITY_ENFORCED” clause to the query
Use bind variables for user input
Hardcode the filterable fields in the Apex controller
Utilise the “with sharing” keyword on the Apex class
Sanitise any user input
24- A developer wishes to write a test for a private method within a class, how can
this be best achieved?
Change the access modifier to be public
Annotate the test class with @Istest(seePrivate=true)
Write a test which executes the public method which calls the private method to be tested
Annotate the private method with @TestVisible
26- What benefits are there to using the Lightning Web Component Framework?
(Choose 4)
Client-side or server-side rendering
Interoperability with popular frameworks such as React or Vue
Can utilise NPM modules
Out-of-the-box components
Built upon web standards
Performance
Faster development
27-A Lead has been converted to a Contact and Account, which triggers are fired?
Triggers on Lead, Contact and Account
Only triggers on Lead
Only triggers on Account
Only triggers on Contact
Triggers on Contact and Account
28-As a developer you have been tasked with creating a simple record form to create
Cases on a private community page, how could you best achieve this?
Imbed Web-to-Case into the page
Build a Visualforce page which utilises the standard case controller
Use a Lightning Component with a Lightning Record Form to display the form
Write a custom component to display the required fields
30-What is the value of “foo” after this following code has been executed?
30
40
10
20
32-A developer wishes to write a single Apex method which can process both
Opportunity and Lead records, what would be the correct method signature?
public static void processRecords( SObject record )
public static void processRecords( <T> record )
public static void processRecords( Object record )
public static void processRecords( <Opportunity, Lead> record )
33-A developer creates an Apex trigger which calls a method within another class. A
test has been written which directly calls the method within the class and provides
100% code coverage. There are no other Apex classes present within the org.
What would be the result of deploying a changeset with this trigger and classes
into production with running all tests?
The deployment succeeds due to code coverage being above 75%
The deployment succeeds due to the total number of lines covered by tests in the deployment being above 75%
The deployment fails as the not every component in the deployment has 75% code coverage
The deployment fails because the Apex trigger has 0% code coverage
34-You have an @AuraEnabled method which accepts an SObject from a Lightning
Component which will be inserted, how can you easily sanitise the user’s input?
Use the DescribeSObjectResult to check the user permissions for each populated field on the SObject
There is no need, @AuraEnabled method automatically enforce FLS
Use the Security.stripInaccessible() method
Use the Database.insertSecure() method
35-You have been requested to generate a simple PDF displaying line items for an
Opportunity. How can you best achieve this?
Search for an App on the AppExchange
Create a Lightning Web Component and call the renderAsPdf() method
Use a third party API
Create a Visualforce page with ‘renderAs=”pdf”’
36-What are the use cases for the Test.startTest() and Test.stopTest() methods
when used within a test class? (Choose 2)
Force asynchronous code the execute synchronously on calling Test.stopTest()
Indicate your test code is executing and to assign it a new set of governor limits
Allow you to change the user to tests are running as
Allow governor limits to be bypassed
37-As a developer you wish to build a reusable Lightning Web Component which can
be used to search records and to select one. Which snippet can this component
alert its parent component to the selected record?
this.dispatchEvent(new CustomEvent(“my_event”, {detail: this.recordId}))
this.dispatchEvent(new CustomEvent(“my_event”, {recordID: this.recordId}))
this.template.dispatchEvent(new CustomEvent(“my_event”, {detail: this.recordId}))
this.template.host.dispatchEvent(new CustomEvent(“my_event”, {detail: this.recordId}))
40-You have been tasked with importing data from a legacy CRM system into a new
Salesforce org. The legacy CRM system had database tables analogous to the
Account, Contact and Opportunity objects within Salesforce. How could you best
ensure the relationships are preserved during this data migration?
Add fields flagged as external Ids for each of the objects to be imported, populated with its legacy CRM Id, use the Data Loader tool,
and set the relationship fields to match these external Ids
Add a field to each object for its legacy CRM Id, write an Apex trigger that on insert matches the record to its parent
Add fields flagged as external Ids for each of the objects to be imported, populated with its legacy CRM Id, write a script to re-
establish relationships after import
Add a field to each object for its legacy CRM Id, after importing each object, export them and use a VLOOKUP function in Excel to
match the Ids
41-Which of the following statements are true about formula fields? (Choose 2)
Formulas don’t have a character limit
Formulas are stored separately from the field themselves
Formulas can span multiple objects
Formulas are calculated at access time
42-You have been tasked with creating a process which sends a very large number
of emails to Contacts within an Org, how best could this be achieved?
Use Email Alerts
Write an automation in Apex to send the emails
Build a Flow to send the emails
Write an integration with an external email provider
Install an AppExchange app
43-Which of the following snippets can be used to obtain the Stage picklist values on
the Opportunity object?
Opportunity.StageName.getDescribe().getPicklistOptions();
Opportunity.StageName.getDescribe().getPicklistDescribe ();
Opportunity.StageName.getDescribe().getPicklistValues();
Opportunity.StageName.getMetadata().getPicklistMetadata();
46- There is a trigger on the Contact object which causes an update on the parent
Account object. The Account update uses an update DML statement and triggers
a validation rule. Which of the following statements is true?
The Contact record is update but the Account is not
The entire transaction is rolled back
The Account trigger is rolled back
The Account record is updated but Contact record is no
47-A developer wishes to iterate over a list of records returned from a query, which of
the following loop types is most appropriate?
Traditional for loop
Do while loop
While loop
SOQL for loop
List or Set for loop
48-You are working for a server installation provider and have been requested that
whenever an Opportunity is created with a value over £10000 to enforce that
there has been a Site Review record created before allowing the Opportunity
stage to be set to Closed Won. How best can this be achieved?
Use an Apex trigger and use the setError() method if the criteria hasn’t been met
Use a record triggered Flow with the “Add Error” action
Use a validation rule which is trigger if the criteria hasn’t been met
Use an Apex trigger and use the addError() method if the criteria hasn’t been met
50-What are the valid target source pairs for a changeset deployment? (Choose 2)
Developer org – Sandbox
Developer org – Production Org
Sandbox – Sandbox
Sandbox – Production Org
52- Which of the following statements should be added to the following for loop to
exit the loop – on line 10 - when a matching record is first found?
break
exit
continue;
goto start
53-Which of the following uses the correct naming convention to be used for naming
CustomEvent fired from Lightning Web Components using dispatch event?
onMyAction
my_action
myAction
my action
54-You are working for a large paint distributor and have been requested that
whenever an Opportunity is created with a value over £10000 to automatically set
the owner to the Sales Team Leader. What automation tool is best suited to this
task?
Use a Workflow Rule
Use a Process Builder
Write an Apex Trigger
Use a Flow
56-An integration is to be built which inserts Leads into your company's Salesforce
instance in bulk from its website daily. Some of the records are spam and do not
contain valid field data. Which of the following statements would facilitate this?
Database.insert(leads, true)
None of the above
Database.insert(leads, false)
insert leads false
Database.insertPartial (leads, false)
58-A developer wishes to add a picklist to a Lightning Web Component they are
building. Which of the following snippets should they use?
<lightning-input type=”picklist”></lightning-input>
<lightning-input type=”combobox”></lightning-input>
<lightning:combobox/ >
<lightning-combobox></lightning-combobox>
<lightning-picklist></lightning- picklist >
<lightning:select/>
59-A developer has many records which must be displayed on a Visualforce page,
how can they best add pagination?
Utilise the StandardController built in methods
Use the OFFSET clause in their SOQL query
Utilise the StandardSetController built in methods
Utilise the StandardPaginationController built in methods
60-As a developer, you wish to utilise scratch orgs to streamline the development
process within your team. What are the requirements to do this?
Enable Dev Hub
All of the above
Have the Salesforce CLI setup
Have a user with permissions to create Scratch Orgs
61-
1- The correct code block for executing a SOSL query within Apex is:
apexCopy code
List<List<SObject>> soslResults = [FIND 'SearchTerm' IN ALL FIELDS RETURNING Account, Contact];
3- The method signature that allows an Apex method to be used by the wire service is:
apexCopy code
@AuraEnabled(cacheable=true) public static Object performAction()
4- To facilitate the utility class to be called from multiple contexts, such as running as an
Experience User and an internal user who should see all records, the appropriate sharing
declaration should be:
Without sharing
apexCopy code
public class MyCustomException extends Exception{}
7- The best way to reference external resources (e.g., CSS or JavaScript) within Lightning
Components and Visualforce pages is:
8- A custom field on Opportunity assigned the number data type, with 18 digits and 0
decimal places, would be assigned the primitive data type:
Decimal
9- To display details about the Account record linked to an Opportunity on a Visualforce
page utilizing the standard controller, you could:
10- The statement that isn't true about Visualforce standard controllers is: - Standard
controllers only exist for custom objects.
11- To declaratively access a specific custom metadata type record within Apex, a
developer can use: apex MyCustomMetadataType__mdt.getInstance('Record_Name');
12- In Salesforce, before-save triggers defined for an object, the order of execution is
based on: - The order in which they are created.
14- Developers can execute an anonymous block of Apex code using: - Use the “Execute
Anonymous” functionality within the Setup area. - Utilize the REST API
“executeAnonymous” endpoint. - Use the “Execute Anonymous” functionality of the
Developer Console.
16- Developers can streamline the setting up of data for their test class by: - Create a
class specifically to create data for test methods. - Add a @TestSetup annotated method
to the class.
19- Before deleting a redundant custom field from Opportunity, one must: - Set the
Field Usage value on the field to DeprecateCandidate.
20- True statements about Flows are: - Flows can be used for both automated processes
and for screen-based processes. - Flows can be triggered on record save, by time-based
triggers, and invoked externally eg via Apex.
21- The value of the instance variable "foo" after the third execution of the given batch
class would be: - 3
24- A developer can best achieve testing a private method within a class by: - Write a
test which executes the public method that calls the private method to be tested.
25- In a before insert trigger, the record values can be updated by modifying: -
Trigger.New.
26- Benefits of using the Lightning Web Component Framework include: - Client-side or
server-side rendering. - Can utilize NPM modules. - Built upon web standards. -
Performance.
27- When a Lead is converted to a Contact and Account, triggers are fired on: - Triggers
on Lead, Contact, and Account.
28- To create a simple record form to create Cases on a private community page, a
developer could best achieve this by: - Use a Lightning Component with a Lightning
Record Form to display the form.
29- Data for a record can be easily accessed in Lightning Components by: - Utilize the
Lightning Data Service.
30- The value of "foo" after the given code has been executed would be: - 30
31- Tools that can be used to develop Lightning Web Components include: - The
Salesforce CLI - VSCode and the Salesforce Extension Pack
32- To write a single Apex method which can process both Opportunity and Lead
records, the correct method signature would be: - public static void
processRecords( List<SObject> records )
33- The result of deploying a changeset with a trigger and classes into production with
running all tests would be: - The deployment succeeds due to code coverage being
above 75%.
34- To easily sanitize user input for an @AuraEnabled method accepting an SObject
from a Lightning Component, a developer can: - Use the Security.stripInaccessible()
method.
35- To generate a simple PDF displaying line items for an Opportunity, a developer
could best achieve this by: - Create a Visualforce page with ‘renderAs=”pdf”’.
36- The use cases for the Test.startTest() and Test.stopTest() methods when used within
a test class are: - Force asynchronous code to execute synchronously on calling
Test.stopTest(). - Indicate your test code is executing and to assign it a new set of
governor limits.
37- To alert the parent component to the selected record in a Lightning Web
Component, a developer should use: - this.dispatchEvent(new CustomEvent("my_event",
{detail: this.recordId}))
38- To react to and handle errors gracefully, a developer can: - Execute the code within
a try-catch block.
39- To track a student’s enrollments on a course and ensure data integrity, the
appropriate data model should be used is: - Create a junction object with master-detail
relationships to both the student and the course.
40- To ensure relationships are preserved during data migration from a legacy CRM
system into Salesforce, a developer could best ensure this by: - Add fields flagged as
external Ids for each of the objects to be imported, populated with its legacy CRM Id,
use the Data Loader tool, and set the relationship fields to match these external Ids.
41- True statements about formula fields are: - Formulas are stored separately from the
field themselves. - Formulas can span multiple objects.
42- To send a very large number of emails to Contacts within an Org, it's best to use an
automation tool like Apex to send the emails. Writing an automation in Apex allows for
more control and customization, especially when dealing with a large volume of emails.
43- The correct snippet to obtain the Stage picklist values on the Opportunity object is:
apexCopy code
Opportunity.StageName.getDescribe().getPicklistValues();
44- If the following trigger is executed for 50 records, the result would be:
45- The maximum number of records that can be processed by a trigger at a time is:
2000
46- In this scenario, if the Account update triggers a validation rule, the entire
transaction is rolled back.
47- When a developer wishes to iterate over a list of records returned from a query, the
most appropriate loop type is:
48- To enforce that there has been a Site Review record created before allowing the
Opportunity stage to be set to Closed Won when an Opportunity is created with a value
over £10000, the best approach is to use a validation rule.
They can be used across both Master-Detail and Lookup relationships, on the
parent side.
50- The valid target source pairs for a changeset deployment are:
52- To exit the loop when a matching record is first found, the correct statement to add
is:
apexCopy code
break;
53- The correct naming convention to be used for naming CustomEvent fired from
Lightning Web Components using dispatch event is:
myAction
54- For automatically setting the owner to the Sales Team Leader when an Opportunity
is created with a value over £10000, the best automation tool suited to this task is:
56- To facilitate inserting Leads into your company's Salesforce instance in bulk from its
website daily, some of which may be spam, the correct statement is:
apexCopy code
Database.insert(leads, false)
57- The true statement about sharing keywords of Apex classes is:
Inner classes inherit the sharing mode from the outer class.
58- To add a picklist to a Lightning Web Component, the correct snippet to use is:
htmlCopy code
<lightning-combobox></lightning-combobox>
59- To best add pagination for many records to be displayed on a Visualforce page, the
developer can: