Salesforce Test 1 For Ranking

Salesforce Test 1 For Ranking

University

68 Qs

quiz-placeholder

Similar activities

Soal UTS Pemrograman Mobile

Soal UTS Pemrograman Mobile

University

70 Qs

PreTest - JAVA

PreTest - JAVA

University

65 Qs

Networking ME

Networking ME

University

65 Qs

WS301 - Quiz

WS301 - Quiz

University

70 Qs

Algorithm, Flowchart & Pseudocode

Algorithm, Flowchart & Pseudocode

University - Professional Development

66 Qs

Prefixes and Suffixes

Prefixes and Suffixes

University

64 Qs

PRE-TEST (IoT - Arduino)

PRE-TEST (IoT - Arduino)

University

70 Qs

PTI (susulan) - UAS

PTI (susulan) - UAS

10th Grade - University

65 Qs

Salesforce Test 1 For Ranking

Salesforce Test 1 For Ranking

Assessment

Quiz

Computers

University

Practice Problem

Medium

Created by

Shivam Chaturvedi

Used 1+ times

FREE Resource

AI

Enhance your content in a minute

Add similar questions
Adjust reading levels
Convert to real-world scenario
Translate activity
More...

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

Google

Continue with Google

Email

Continue with Email

Classlink

Continue with Classlink

Clever

Continue with Clever

or continue with

Microsoft

Microsoft

Apple

Apple

Others

Others

Already have an account?