Dev 1 (26 en adelante)

Dev 1 (26 en adelante)

1st Grade

12 Qs

quiz-placeholder

Similar activities

test game

test game

1st Grade

13 Qs

Ranneeti Shivir East Zone

Ranneeti Shivir East Zone

1st Grade

12 Qs

Revision BUSS1610D

Revision BUSS1610D

1st Grade

15 Qs

Chapter 3 Topic 2 - Understanding Users

Chapter 3 Topic 2 - Understanding Users

KG - 5th Grade

10 Qs

Dev 3/21

Dev 3/21

1st Grade

14 Qs

Dev 1 3/17

Dev 1 3/17

1st Grade

8 Qs

Tavi quiz

Tavi quiz

1st - 5th Grade

15 Qs

Organising Business (semi 2)

Organising Business (semi 2)

1st Grade

10 Qs

Dev 1 (26 en adelante)

Dev 1 (26 en adelante)

Assessment

Quiz

Business

1st Grade

Hard

Created by

Megan Santos

Used 1+ times

FREE Resource

12 questions

Show all answers

1.

MULTIPLE SELECT QUESTION

1 min • 1 pt

26. What data types can a SOQL query return? (Select 3)

List<SObject>

SObject

Integer

Map<Id, SObject>

Map<String, Object>

Answer explanation

Media Image

The SOQL engine within Apex is incredibly flexible in how we can call it, and how it returns data for us to consume with the code. The most

common return type is a List<SObjects>, this will be when a simple query is run. The SObject return type can be used when a query is known to

return a single record only, for example when using a LIMIT 1 or querying for a specific ID. The integer return type is used when we use the

COUNT query function.

2.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

Which of the following code blocks is correct for executing a SOSL query within Apex?

Map<Schema.SObjectType, List<SObject>> soslResults = [FIND ‘SearchTerm’ IN ALL FIELDS RETURNING Account, Contact];

List<Database.SoslResult> soslResults = [FIND ‘SearchTerm’ IN ALL FIELDS RETURNING Account, Contact];

List<List<SObject>> soslResults = [FIND ‘SearchTerm’ IN ALL FIELDS RETURNING Account, Contact];

Map<String, List<SObject>> soslResults = [FIND ‘SearchTerm’ IN ALL FIELDS RETURNING Account, Contact];

Answer explanation

Media Image

SOSL queries return a List<List<SObject>>, with each list being the results for a specific SObject type, the order of which is the same as defined

within the query. I.e. if Account was the third SObject in the RETURNING clause, the list at the second index would be a list of the Account

results. This is because SOSL queries are performed against multiple objects at once.

3.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

A developer has many records which must be displayed on a Visualforce page, how can they best add pagination?

• Use the OFFSET clause in their SOQL query

• Utilise the StandardSetController built in methods

• Utilise the StandardController built in methods

• Utilise the StandardPaginationController built in methods

Use the OFFSET clause in their SOQL query

Utilize the StandardSetController built in methods

Utilize the StandardController built in methods

Utilize the StandardPaginationController built in methods

Answer explanation

The StandardSetController is designed to work with sets of records, and so provides built in methods to enable a large set of records to be

displayed on a Visualforce page, with methods to assist in pagination of the record list.

4.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

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?

Add the “WITH SECURITY_ENFORCED” clause to the query

Use bind variables for user input and Sanitise any user input

Hardcode the filterable fields in the Apex controller

Utilise the “with sharing” keyword on the Apex class

All of the options

Answer explanation

Any area where user input is used to query data within the database should be considered an avenue for attack and should be protected against.

Sanitising the user input protects against SOQL injection by ensuring values are treated as values and not accidently interpreted as extensions to

a query. This is easily achieved with bind variables.

The “WITH SECURITY_ENFORCED” clause of a query prompts the SOQL engine to enforce permissions on the query, so if a query attempts to

access a field or object the user doesn’t have access to, an exception is thrown.

A piece of Apex should never trust search parameters from a Lightning Component as these could easily be manipulated. Instead, in scenarios

where this is required, alternative approaches should be used such as hardcoding the filter variables in an Apex datatype or as parameters to the

method, in order to ensure that any requested fields/filters have been explicitly pre authorised.

5.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

Media Image

What is the result if the following trigger is executed for 50 records?

The records are updated to have the MyField__c value of “TRUE”

The first record is updated to have the MyField__c value of “TRUE”

A runtime exception is thrown

The code will not compile

Answer explanation

The variables which are present within a Trigger are dependent on the current trigger context. In this case we are operating in a Before Insert

context, this means the record hasn’t been inserted into the database yet and so there can be no old value for the record, and so the Trigger will

throw a null pointer exception on line 2.

6.

MULTIPLE SELECT QUESTION

1 min • 1 pt

Which of the following statements is true about Flows? (Choose 2)

Flows can be triggered on record save, by time-based triggers, and invoked externally eg via Apex

Flows require test coverage to deploy

Before save flows run after Apex before triggers

Flows can be used for both automated processes and for screen-based processes

Answer explanation

Flows can be invoked from numerous different sources; these can be split into two categories. Screen based flows which combine automated

processes with screens presented to a user. The other type are headless flows, these run without any user interface, just like Apex triggers.

Headless flows have many invocation mechanisms, which can be further categorised into record triggered, scheduled, and externally triggered.

Like the name suggests, record triggered flows are triggered from record actions, such as save or update, and can operate in both a before and

after save context. Scheduled flows are time-based flows, invoked at a specific time or interval. Lastly invokable flows are invoked via something

external to the flow, this could be another flow, a process builder, Apex or via the API.

While test coverage is generated for flows, it is not a requirement to get 75% test coverage for a flow to be deployed to production, unlike Apex.

7.

MULTIPLE SELECT QUESTION

1 min • 1 pt

What are the use cases for the Test.startTest() and Test.stopTest() methods when used within a test class? (Choose 2)

• 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

• 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

Force asynchronous code the execute synchronously on calling Test.stopTest()

Answer explanation

Media Image

• Setup – preparing data and the runtime environment for your testing scenario

• Execution – executing the code you wish to test

• Validation – verifying the results of the executed test against the expected results

The process of setting up and preparing a test can result in the consumption of many governor limits before the actual code we wish to validate

has been run, for example having to insert Accounts if you wish to validate a rollup from Opportunity.

This is not an ideal scenario as it causes our test execution to potentially not run in a realistic environment. We can use the Test.startTest()

method just before executing the code we wish to test to assign that block of code a new set of governor limits. We can then call Test.startTest()

once we’ve finished our execution and are ready to validate our results.

Create a free account and access millions of resources

Create resources
Host any resource
Get auto-graded reports
or continue with
Microsoft
Apple
Others
By signing up, you agree to our Terms of Service & Privacy Policy
Already have an account?