Questions Flashcards
What must the Controller for a Visualforce page utilize to override the Standard Opportunity view button?
A. The StandardSetController to support related lists for pagination.
B. the Opportunity StandardController for pre -built functionality.
C. A callback constructor to reference the StandardController.
D.A constructor that initializes a private Opportunity variable.
B. the Opportunity StandardController for pre -built functionality.
An org has different Apex Classes that provide Account -related functionality.
After a new validation rule is added to the object, many of the test methods fail.
What can be done to resolve the failures and reduce the number of code changes needed for future validation rules?
Choose 2 answers:
A. Create a method that creates valid Account records, and call this method from within test methods.
B. Create a method that loads valid Account records from a Static Resource, and call this method within test methods.
C. Create a method that performs a callout for a valid Account record, and call this method from within test methods.
D Create a method that queries for valid Account records, and call this method from within test methods.
A. Create a method that creates valid Account records, and call this method from within test methods.
B. Create a method that loads valid Account records from a Static Resource, and call this method within test methods.
A company has a custom object named Warehouse. Each Warehouse record has a distinct record owner, and is related to a parent Account in Salesforce.
Which kind of relationship would a developer use to relate the Account to the Warehouse?
A. One -to -Many
B. Lookup
C. Master -Detail
D. Parent -Child
B. Lookup
In an organization that has enabled multiple currencies, a developer needs to aggregate the sum of the Estimated_value__c currency field from the CampaignMember object using a roll-up summary field called Total_estimated_value__c on Campaign.
How is the currency of the Total_estimated_value__c roll-up summary field determined?
A. The values in Campaignmember.Estimated_value__c are converted into the currency of the Campaign record and the sum is displayed using the currency on the Campaign record.
B. The values in CampaignMember.Estimated_value__c are converted into the currency on the majority of the CampaignMember records and the sum is displayed using that currency.
C. The values in CampaignMember.Estimated_value__c are summed up and the resulting Total_estimated_value__c field is displayed as a numeric field on the Campaign record.
D. The values In CampaignMember.Estimated_value__c are converted into the currency of the current user, and the sum is displayed using the currency on the Campaign record.
A. The values in Campaignmember.Estimated_value__c are converted into the currency of the Campaign record and the sum is displayed using the currency on the Campaign record.
Which requirement needs to be implemented by using standard workflow instead of Process Builder?
Choose 2 answers
A. Create activities at multiple intervals.
B. Send an outbound message without Apex code.
C. Copy an account address to its contacts.
D. Submit a contract for approval.
A. Create activities at multiple intervals.
B. Send an outbound message without Apex code.
A candidate may apply to multiple jobs at the company Universal Containers by submitting a single application per job posting, that application cannot be modified to be resubmitted to a different job posting.
What can the administrator do to associate an application with each job posting in the schema for the organization?
A. Create a lookup relationship on both objects to a junction object called Job Posting Applications.
B. Create a master-detail relationship in the Job Postings custom object to the Applications custom object.
C. Create a master-detail relationship in the Application custom object to the Job Postings custom object.
D. Create a lookup relationship in the Applications custom object to the Job Postings custom object.
C. Create a master-detail relationship in the Application custom object to the Job Postings custom object.
What is a capability of cross-object formula fields?
Choose 3 answers
A. Formula fields can reference fields from master-detail or lookup parent relationships.
B. Formula fields can expose data the user does not have access to in a record.
C. Formula fields can be used in three roll-up summaries per object.
D. Formula fields can reference fields in a collection of records from a child relationship.
E. Formula fields can reference fields from objects that are up to 10 relationships away.
A. Formula fields can reference fields from master-detail or lookup parent relationships.
B. Formula fields can expose data the user does not have access to in a record.
E. Formula fields can reference fields from objects that are up to 10 relationships away.
How can a developer avoid exceeding governor limits when using an Apex Trigger?
choose 2 answers
A. By using a helper class that can be invoked from multiple triggers.
B. By using the Database class to handle DML transactions.
C. By using Maps to hold data from query results.
D. By performing DML transactions on lists of SObjects.
C. By using Maps to hold data from query results.
D. By performing DML transactions on lists of SObjects.
What is the accurate statement about with sharing keyword?
choose 2 answers
A) Inner class do not inherit the sharing setting from the container class B) Both inner and outer class can be declared as with sharing C) Either inner class or outer classes can be declared as with sharing but not both D) Inner class inherit the sharing setting from the conatiner class
A) Inner class do not inherit the sharing setting from the container class B) Both inner and outer class can be declared as with sharing
How can a developer refer to, or instantiate a PageReference in Apex?
Choose 2 answers
A. By using a PageReference with a partial or full URL.
B. By using the Page object and a Visualforce page name.
C. By using the ApexPages.Page() method with a Visualforce page name.
D. By using the PageReference.Page() method with a partial or full URL.
A. By using a PageReference with a partial or full URL.
B. By using the Page object and a Visualforce page name.
Which standard field needs to be populated when a developer inserts new Contact records programmatically?
A. Accountld
B. Name
C. LastName
D. FirstName
C. LastName
A developer has a single custom controller class that works with a Visualforce Wizard to support creating and editing multiple sObjects. The wizard accepts data from user inputs across multiple Visualforce pages and from a parameter on the initial URL Which statement is unnecessary inside the unit test for the custom controller?
A. public ExtendedController (ApexPages.StandardController cntrl) { }
B. ApexPages.currentPage().getParameters().put(‘input’, ‘TestValue’)
C. Test.setCurrentPage(pageRef),
D. String nextPage = controller.save().getUrl();
A. public ExtendedController (ApexPages.StandardController cntrl) { }
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 answers
A. Use Schema.PIcklistEntry returned by Case Status getDescribe().getPicklistValues().
B. Use Schema.RecordTypeinfo returned by Case.SObjectType getDescribe().getRecordTypelnfos()
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 value for the Status picklist field.
A. Use Schema.PIcklistEntry returned by Case Status getDescribe().getPicklistValues().
B. Use Schema.RecordTypeinfo returned by Case.SObjectType getDescribe().getRecordTypelnfos()
An sObject named Application_c has a lookup relationship to another sObject named Position_c. Both Application _c and Position_c have a picklist field named Status_c.
When the Status_c field on Position_c is updated, the Status_c field on Application_c needs to be populated automatically with the same value, and execute a workflow rule on Application_c.
How can a developer accomplish this?
A. By changing Application_c.Status_c into a roll -up summary field.
B. By changing Application_c.Status_c into a formula field.
C. By using an Apex trigger with a DML operation.
D. By configuring a cross-object field update with a workflow.
B. By changing Application_c.Status_c into a formula field.
A developer wrote a workflow email alert on case creation so that an email is sent to the case owner manager when a case is created? When will the email be sent?
A. Before Trigger execution
B. After Committing to database.
C. Before Committing to database
D. After Trigger execution.
B. After Committing to database.
A developer in a Salesforce org with 100 Accounts executes the following code using the Developer console:
Account myAccount = new Account(Name = ‘MyAccount’);
Insert myAccount;
For (Integer x = 0; x “less than” 250; x++)
Account newAccount = new Account (Name=’MyAccount’ + x);
try {
Insert newAccount;
}
catch (Exception ex) {
System.debug (ex) ;
}
insert new Account (Name=’myAccount’);
How many accounts are in the org after this code is run? A. 101 B. 100 C. 102 D. 252
B. 100
When would a developer use a custom controller instead of a controller extension?
Choose 2 answers:
A. When a Visualforce page needs to replace the functionality of a standard controller.
B. When a Visualforce page does not reference a single primary object.
C. When a Visualforce page should not enforce permissions or field-level security.
D. When a Visualforce page needs to add new actions to a standard controller.
A. When a Visualforce page needs to replace the functionality of a standard controller.
C. When a Visualforce page should not enforce permissions or field-level security.
What is a valid statement about Apex classes and interfaces?
Choose 2 answers:
A. The default modifier for a class is private. B. Exception classes must end with the word exception. C. A class can have multiple levels of inner classes. D. The default modifier for an interface is private.
A. The default modifier for a class is private. B. Exception classes must end with the word exception.
On a Visualforce page with a custom controller, how should a developer retrieve a record by using an ID that is passed on the URL?
A. Use the constructor method for the controller.
B. Use the $Action.View method in the Visualforce page.
C. Create a new PageReference object with the Id.
D. Use the “apex:detail” tag in the Visualforce page.
A. Use the constructor method for the controller.
Which user can edit a record after it has been locked for approval?
Choose 2 answers
A An administrator.
B. Any user who approved the record previously.
C. A user who is assigned as the current approver.
D. Any user- with a higher role in the hierarchy.
A An administrator.
C. A user who is assigned as the current approver.
Which type of information is provided by the Checkpoints tab in the Developer Console?
Choose 2 answers
A. Exception
B. Debug Statement
C. Namespace
D. Time
C. Namespace
D. Time
Which declarative method helps ensure quality data?
Choose 3 answers
A. Exception handling B. Workflow alerts C. Validation rules D. Lookup filters E. Page layouts
C. Validation rules
D. Lookup filters
E. Page layouts
Which code block returns the ListView of an Account object using the following debug statement?
system. debug (controller. getListViewOptions ( ) ) ;
A. ApexPages.StandardSetController controller = new ApexPages.StandardSetController([SELECT Id FROM Account LIMIT 1]); B. ApexPages.StandardController controller = new ApexPages.StandardController(Database.getQueryLocator('select Id from Account Limit 1'); C. ApexPages.StandardController controller = new ApexPages StandardController ( [SELECT Id FROM Account LIMIT 1)); D.ApexPages.StandardSetController controller = new ApexPages.StandardSetController(Database.getQueryLocator('select Id from Account Limit 1');
D.ApexPages.StandardSetController controller = new
ApexPages.StandardSetController(Database.getQueryLocator(‘select Id from Account Limit 1’);
Where can debug log filter settings be set?
Choose 2 answers
A. The Filters link by the monitored user’s name within the web UI.
B. The Show More link on the debug log’s record.
C. On the monitored user’s name.
D. The Log Filters tab on a class or trigger detail page.
B. The Show More link on the debug log's record. D. The Log Filters tab on a class or trigger detail page.