Salesforce Test 1 For Ranking

Salesforce Test 1 For Ranking

University

68 Qs

quiz-placeholder

Similar activities

INFS324

INFS324

University

64 Qs

JavaScript Basics Quiz (Medium)

JavaScript Basics Quiz (Medium)

University

65 Qs

Storia - Hardware 1_ Tallini

Storia - Hardware 1_ Tallini

1st Grade - University

63 Qs

MUITICT_06_test

MUITICT_06_test

University

72 Qs

7th standard foxpro

7th standard foxpro

KG - University

70 Qs

Soft Eng Quiz 3 (Part 1)

Soft Eng Quiz 3 (Part 1)

University

63 Qs

Information Management Prefinals

Information Management Prefinals

University

73 Qs

Types of Testing

Types of Testing

University

67 Qs

Salesforce Test 1 For Ranking

Salesforce Test 1 For Ranking

Assessment

Quiz

Computers

University

Medium

Created by

Shivam Chaturvedi

Used 1+ times

FREE Resource

68 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

45 sec • 1 pt

What will be the output of this Apex code? Integer sum = 0; List nums = new List{2, 4, 6}; for(Integer i : nums){ if(i % 2 == 0){ sum += i; } } System.debug(sum);

12

6

0

10

2.

MULTIPLE CHOICE QUESTION

45 sec • 1 pt

What is the result of the following Apex code? Map myMap = new Map(); myMap.put('A', 10); myMap.put('B', 20); myMap.put('A', 30); System.debug(myMap.get('A'));

10

20

30

Null

3.

MULTIPLE CHOICE QUESTION

45 sec • 1 pt

What does the following Apex code do? Set accIds = new Set(); for(Account acc : Trigger.new){ accIds.add(acc.Id); }

Deletes the account records

Creates duplicate account IDs

Stores unique Account Ids

Throws compile-time error

4.

MULTIPLE CHOICE QUESTION

45 sec • 1 pt

What will be the result of this Apex code? List accList = [SELECT Id FROM Account LIMIT 2]; delete accList; System.debug('Deleted');

Deletes only one record

Deletes two records

Causes an error

Updates records

5.

MULTIPLE CHOICE QUESTION

45 sec • 1 pt

What is the correct bulkified version of this trigger logic? trigger AutoTask on Opportunity (after insert) { for(Opportunity opp : Trigger.new){ Task t = new Task(Subject='Follow Up', WhatId=opp.Id); insert t; } }

Move loop inside insert

Create one task per opportunity

Use a List to collect and insert tasks outside the loop

Use SOQL inside loop

6.

MULTIPLE CHOICE QUESTION

45 sec • 1 pt

What does this code snippet do? List accounts = new List(); for(Integer i = 0; i < 3; i++){ accounts.add(new Account(Name='Test' + i)); } insert accounts;

Inserts 3 accounts with same name

Inserts 3 accounts with unique names

Fails due to duplicate

Fails due to null values

7.

MULTIPLE CHOICE QUESTION

45 sec • 1 pt

What exception is thrown when a DML statement fails partially? try { insert new List{ new Account(Name='Test1'), new Account() // Missing required field }; } catch(Exception e){ System.debug(e.getMessage()); }

NullPointerException

QueryException

DmlException

ListException

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?