Dev 1 - 31 onwards

Dev 1 - 31 onwards

1st Grade

12 Qs

quiz-placeholder

Similar activities

Revamped New Hire Induction

Revamped New Hire Induction

KG - 12th Grade

15 Qs

Fun Fun Fun

Fun Fun Fun

1st Grade

11 Qs

Component 3 - Revenue/Costs Part 2 - Topic 4

Component 3 - Revenue/Costs Part 2 - Topic 4

1st - 12th Grade

12 Qs

Introduction to Management Week 6

Introduction to Management Week 6

1st - 3rd Grade

10 Qs

DE CHAPTER 5

DE CHAPTER 5

1st Grade

10 Qs

UHAK1032-Entrepreneuship

UHAK1032-Entrepreneuship

1st - 5th Grade

10 Qs

GANGES CANAL

GANGES CANAL

1st Grade - University

10 Qs

Dev 1 full dump

Dev 1 full dump

1st Grade

14 Qs

Dev 1 - 31 onwards

Dev 1 - 31 onwards

Assessment

Quiz

Business

1st Grade

Hard

Created by

Megan Santos

Used 1+ times

FREE Resource

12 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

39. 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 Visualforce page with ‘renderAs=”pdf”’

Create a Lightning Web Component and call the renderAsPdf() method

Use a third party API

Answer explanation

Visualforce pages are the only on-platform technology that can be used to render PDFs, and since the PDF to be generated here is simple,

utilising this functionality is the best approach.

For more complex PDFs, utilising an AppExchange app would be preferred since it wouldn’t require developers to build something from scratch,

and instead would only require installing an App.

2.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

Media Image

What is the value of “foo” after this following code has been executed?

10

20

30

40

Answer explanation

Switch statements allow a developer to test whether an expression matches one of several different values in a branch, and perform some code based on the matching branch.

In the question, the switch operation compares an Enum value against several options. Since the value operation is AFTER_INSERT, the switch statement evaluates each branch until it matches the AFTER_INSERT value, which executes the code block, which sets foo to equal 30.

3.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

Media Image

What would the value of the instance variable “foo” be after the third execution of the following batch class?

1

2

3

4

Answer explanation

The instance variable is initially initialised as 1 during the constructor of the batch class. This is then incremented by 1 for each execute method

run. Since this batch class also implements Database.Stateful, the instance variables of this class are preserved after each execute method call,

hence why the output value is 4.

4.

MULTIPLE SELECT QUESTION

1 min • 1 pt

What are the valid target source pairs for a changeset deployment? (Choose 2)

Developer org – Production Org

Developer org – Sandbox

Sandbox – Sandbox

Sandbox – Production Org

Answer explanation

Changesets are only available within a production org and its sandboxes. The purpose of them is to allow development and testing to be done in

a metadata clone of a production org, and for those changes to be migrated into production when ready.

Since developer orgs are not tied to a production instance and are instead standalone, they do not feature changesets and so cannot be the

target nor the source of a changeset deployment

5.

MULTIPLE SELECT QUESTION

1 min • 1 pt

How can a developer execute an anonymous block of Apex code? (Choose 3)

• Use the “Execute Anonymous” functionality of the Developer Console

• Use the “Execute Anonymous” functionality within the Setup area

• Utilise the REST API “executeAnonymous” endpoint

• Use the Salesforce CLI “force:apex:execute” command

• 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

• Use the “Execute Anonymous” functionality within the Setup area

• Utilise the REST API “executeAnonymous” endpoint

• Use the Salesforce CLI “force:apex:execute” command

• Use the Salesforce CLI “force:apex:execute:anonymous” command

Answer explanation

Media Image

Anonymous Apex code can be executed both on platform and off platform. On platform this is done directly in the Developer Console, utilising the Developer Console’s inbuilt functionality.

When we wish to run code off platform, there are several ways this can be achieved. One of the easiest is to utilise the Salesforce CLI commands, as these can run code directly from either a terminal, or from code stored within a file. Lastly we can utilise either the SOAP or the REST APIs to send code to Salesforce to be executed.

6.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

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?

There is no need, @AuraEnabled method automatically enforce FLS

Use the Database.insertSecure() method

Use the DescribeSObjectResult to check the user permissions for each populated field on the SObject

Use the Security.stripInaccessible() method

Answer explanation

Media Image

The Security class methods are designed explicitly for easily enforcing the FLS of the current user by stripping anything which is not accessible in

the defined context.

While checking each field’s accessibility using the DescribeSObjectResult for the SObject is a valid approach, it is far more verbose and requires

a lot more code to achieve the same results as utilising the Security.stripInaccessible() methods.

7.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

How can a developer declaratively access a specific custom metadata type (MyCustomMetadataType__mdt) record within Apex?

MyCustomMetadataType__mdt.getRecord(‘Record_Name’);

CustomMetadata.get(‘MyCustomMetadataType__mdt’).get(‘Record_Name’);

MyCustomMetadataType__mdt.getInstance(‘Record_Name’);

MyCustomMetadataType__mdt.(‘Record_Name’);

Answer explanation

Each custom metadata type comes with its own SObject type in Apex. This type contains additional methods which can be used to declaratively

obtain records from a custom metadata type by developer name or record Id. These methods are similar to those found on custom settings.

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?