Go Back on CRT-450 Exam
Available in 1, 3, 6 and 12 Months Free Updates Plans
PDF: $15 $60

Test Engine: $20 $80

PDF + Engine: $25 $99

CRT-450 Practice Test


Page 13 out of 78 Pages

Topic 1 : Exam Pool A

How can a developer set up a debug log on a specific user?


A.

It is not possible to setup debug logs for users other than yourself.


B.

Ask the user for access to their account credentials, log in as the user and debug the issue.


C.

Create Apex code that logs code actions into a custom object.


D.

Set up a trace flag for the user, and define a logging level and time period for the trace.





D.
  

Set up a trace flag for the user, and define a logging level and time period for the trace.



A method is passed a list of generic sObjects as a parameter.
What should the developer do to determine which object type (Account, Lead, or Contact, for example) to cast each sObject?


A.

Use the first three characters of the sObject ID to determine the sObject type.


B.

Use the getSObjectType method on each generic sObject to retrieve the sObject token.


C.

Use the getSObjectName method on the sObject class to get the sObject name.


D.

Use a try-catch construct to cast the sObject into one of the three sObject types





B.
  

Use the getSObjectType method on each generic sObject to retrieve the sObject token.



A developer wrote a unit test to confirm that a custom exception works properly in a custom controller, but the
test failed due to an exception being thrown.
Which step should the developer take to resolve the issue and properly test the exception?


A.

Use try/catch within the unit test to catch the exception.


B.

Use the finally bloc within the unit test to populate the exception.


C.

Use the database methods with all or none set to FALSE.


D.

Use Test.isRunningTest() within the custom controller





A.
  

Use try/catch within the unit test to catch the exception.



An org has a single account named ‘NoContacts’ that has no related contacts. Given the query:
List<Account> accounts = [Select ID, (Select ID, Name from Contacts) from Account where
Name=‘NoContacts’];What is the result of running this Apex?


A.

accounts[0].contacts is invalid Apex.


B.

accounts[0].contacts is an empty Apex.


C.

accounts[0].contacts is Null.


D.

A QueryException is thrown.





B.
  

accounts[0].contacts is an empty Apex.



A custom exception "RecordNotFoundException" is defined by the following code of block.public class
RecordNotFoundException extends Exception()which statement can a developer use to throw a custom
exception?choose 2 answers


A.

Throw new RecordNotFoundException("problem occured");


B.

Throw new RecordNotFoundException();


C.

throw RecordNotFoundException("problem occured");


D.

Throw RecordNotFoundException();





A.
  

Throw new RecordNotFoundException("problem occured");



B.
  

Throw new RecordNotFoundException();




Page 13 out of 78 Pages
Previous