Salesforce CRT 450 Exam Page 2(Dumps)
Question No:-11
|
A developer working on a time management application wants to make total hours for each timecard available to application users. A timecard entry has a Master- Detail relationship to a timecard.
Which approach should the developer use to accomplish this declaratively?
1. A Visualforce page that calculates the total number of hours for a timecard and displays it on the page
2. A Roll-Up Summary field on the Timecard Object that calculates the total hours from timecard entries for that timecard
3. A Process Builder process that updates a field on the timecard when a timecard entry is created
4. An Apex trigger that uses an Aggregate Query to calculate the hours for a given timecard and stores it in a custom field
Answer:-2. A Roll-Up Summary field on the Timecard Object that calculates the total hours from timecard entries for that timecard
|
|
Question No:-12
|
A developer encounters APEX heap limit errors in a trigger.
Which two methods should the developer use to avoid this error? (Choose two.)
1. Use the transient keyword when declaring variables.
2. Query and store fields from the related object in a collection when updating related objects.
3. Remove or set collections to null after use.
4. Use SOQL for loops instead of assigning large queries results to a single collection and looping through the collection.
Answer:-(1) and (4)
Most of the people choose (3) and (4) as there answer
|
|
Question No:-13
|
Which approach should be used to provide test data for a test class?
1. Query for existing records in the database.
2. Execute anonymous code blocks that create data.
3. Use a test data factory class to create test data.
4. Access data in @TestVisible class variables.
Answer:-3. Use a test data factory class to create test data.
|
|
Question No:-14
|
Which approach should a developer take to automatically add a `Maintenance Plan` to each Opportunity that includes an `Annual Subscription` when an opportunity is closed?
1. Build a OpportunityLineItem trigger that adds a PriceBookEntry record.
2. Build an OpportunityLineItem trigger to add an OpportunityLineItem record.
3. Build an Opportunity trigger that adds a PriceBookEntry record.
4. Build an Opportunity trigger that adds an OpportunityLineItem record.
Answer:-4. Build an Opportunity trigger that adds an OpportunityLineItem record.
|
|
Question No:-15
|
Which two statements are true about using the @testSetup annotation in an Apex test class? (Choose two.)
1. The @testSetup annotation cannot be used when the @isTest(SeeAllData=True) annotation is used.
2. Test data is inserted once for all test methods in a class.
3. Records created in the @testSetup method cannot be updates in individual test methods.
4. The @testSetup method is automatically executed before each test method in the test class is executed.
Answer:-(1) and (4)
Most of the people choose (1) and (2) as there answer
|
|
Question No:-16
|
What is the requirement for a class to be used as a custom Visualforce controller?
1. Any top-level Apex class that has a constructor that returns a PageReference
2. Any top-level Apex class that extends a PageReference
3. Any top-level Apex class that has a default, no-argument constructor
4. Any top-level Apex class that implements the controller interface
Answer:-4. Any top-level Apex class that implements the controller interface
People select option (3) as there answer
|
|
Question No:-17
|
A Visualforce page is required for displaying and editing Case records that includes both standard and custom functionality defined in an Apex class called myControllerExtension.
The Visualforce page should include which attribute(s) to correctly implement controller functionality?
1. controller=ג€Caseג€ and extensions=ג€myControllerExtensionג€
2. extensions=ג€myControllerExtensionג€
3. controller=ג€myControllerExtensionג€
4. standardController=ג€Caseג€ and extensions=ג€myControllerExtensionג€
Answer:-4. standardController=ג€Caseג€ and extensions=ג€myControllerExtensionג€
|
|
Question No:-18
|
A newly hired developer discovers that there are multiple triggers on the case object.
What should the developer consider when working with triggers?
1. Developers must dictate the order of trigger execution.
2. Trigger execution order is based on creation date and time.
3. Unit tests must specify the trigger being tested.
4. Trigger execution order is not guaranteed for the same sObject.
Answer:-4. Trigger execution order is not guaranteed for the same sObject.
|
|
Question No:-19
|
How should a developer prevent a recursive trigger?
1. Use a ג€one trigger per objectג€ pattern.
2. Use a static Boolean variable.
3. Use a trigger handler.
4. Use a private Boolean variable.
Answer:-2. Use a static Boolean variable.
|
|
Question No:-20
|
Which three options can be accomplished with formula fields? (Choose three.)
1. Generate a link using the HYPERLINK function to a specific record.
2. Display the previous value for a field using the PRIORVALUE function.
3. Determine if a datetime field value has passed using the NOW function.
4. Return and display a field value from another object using the VLOOKUP function.
5. Determine which of three different images to display using the IF function.
|
|