1 Contact con = new Contact( LastName ='Smith', Department = 'Admin') 2 insert con; 3 Contact insertedContact=[select Name from Contact where id=:con.Id]; 4 Savepoint sp_admin = Database.setSavepoint(); 5 con.Department = 'HR'; 6 update con; 7 Database.rollback(sp_admin); 8 System.debug(Limits.getDmlStatements()); Given the following code, what value will be output in the logs by line #8?

QuestionsCategory: Certified Platform Developer II1 Contact con = new Contact( LastName ='Smith', Department = 'Admin') 2 insert con; 3 Contact insertedContact=[select Name from Contact where id=:con.Id]; 4 Savepoint sp_admin = Database.setSavepoint(); 5 con.Department = 'HR'; 6 update con; 7 Database.rollback(sp_admin); 8 System.debug(Limits.getDmlStatements()); Given the following code, what value will be output in the logs by line #8?
Admin Staff asked 4 months ago
1 Contact con = new Contact( LastName ='Smith', Department = 'Admin')
2 insert con;
3 Contact insertedContact=[select Name from Contact where id=:con.Id];
4 Savepoint sp_admin = Database.setSavepoint();
5 con.Department = 'HR';
6 update con;
7 Database.rollback(sp_admin);
8 System.debug(Limits.getDmlStatements());
Given the following code, what value will be output in the logs by line #8?

A. 5

B. 3

C. 4

D. 2








 

Suggested Answer: C

Community Answer: C



This question is in Certified Platform Developer II Exam
For getting Salesforce Certified Platform Developer II











Disclaimers:
The website is not related to, affiliated with, endorsed or authorized by Salesforce. 
Trademarks, certification & product names are used for reference only and belong to Salesforce.
The website does not contain actual questions and answers from Salesforce's Certification Exams.

Recommended

Welcome Back!

Login to your account below

Create New Account!

Fill the forms below to register

Retrieve your password

Please enter your username or email address to reset your password.