CRT-450 Exam Questions

Total 387 Questions

Last Updated Exam : 22-Nov-2024

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();



A developer uses a before insert trigger on the Lead object to fetch the Territory__c object, where the
Territory__c.PostalCode__c matches the Lead.PostalCode. The code fails when the developer uses the Apex
Data Loader to insert 10,000 Lead records. The developer has the following code block: Line-01: for (Lead l :
Trigger.new){Line-02: if (l.PostalCode != null) {Line-03: List<Territory__c> terrList = [SELECT Id FROM
Territory__c WHERE PostalCode__c = :l.PostalCode];Line-04: if(terrList.size() > 0) Line-05: l.Territory__c =
terrList[0].Id; Line-06: }Line-07: }Which line of code is causing the code block to fail?


A.

Line-03: A SOQL query is located inside of the for loop code.


B.

Line-01: Trigger:new is not valid in a before insert Trigger.


C.

Line-02: A NullPointer exception is thrown if PostalCode is null.


D.

Line-05: The Lead in a before insert trigger cannot be updated.





A.
  

Line-03: A SOQL query is located inside of the for loop code.



A developer wants to display all of the available record types for a Case object. The developer also wants to display the picklist values for the Case.Status field. The Case object and the Case.Status field are on a custom Visualforce page. Which action can the developer perform to get the record types and picklist values in the controller? (Choose 2)


A.

Use Schema.PicklistEntry returned by Case.Status.getDescribe().getPicklistValues().


B.

Use Schema.RecordTypeInfo returned by Case.sObjectType.getDescribe().getRecordTypeInfos().


C.

Use SOQL to query Case records in the org to get all the RecordType values available for Case.


D.

Use SOQL to query case records in the org to get all values for the Status picklist field.





A.
  

Use Schema.PicklistEntry returned by Case.Status.getDescribe().getPicklistValues().



B.
  

Use Schema.RecordTypeInfo returned by Case.sObjectType.getDescribe().getRecordTypeInfos().



What is the result when a Visualforce page calls an Apex controller, which calls another Apex class, which
then results in hitting a governor limit?


A.

Any changes up to the error are saved.


B.

Any changes up to the error are rolled back.


C.

All changes before a savepoint are saved.


D.

All changes are saved in the first Apex clas





B.
  

Any changes up to the error are rolled back.



Which statement would a developer use when creating test data for products and pricebooks?


A.

Id pricebookId = Test.getStandardPricebookId();


B.

Pricebook pb = new Pricebook();


C.

IsTest(SeeAllData = false);


D.

List objList = Test.loadData(Account.sObjectType, 'myResource');





A.
  

Id pricebookId = Test.getStandardPricebookId();



To which primitive data type in Apex is a currency field atomically assigned?


A.

Integer


B.

Decimal


C.

Double


D.

Currency





B.
  

Decimal




Page 7 out of 39 Pages
Previous