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 14 out of 78 Pages

Topic 2 : Exam Pool B

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 14 out of 78 Pages
Previous