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.
When can a developer use a custom Visualforce page in a Force.com application?
Choose 2 answers
A. To create components for dashboards and layouts.
B. To deploy components between two organizations.
C. To generate a PDF document with application data.
D. To modify the page layout settings for a custom object.
A. To create components for dashboards and layouts.
C. To generate a PDF document with application data.
The Sales Management team hires a new intern. The intern is not allowed to view Opportunities, but needs to see the Most Recent Closed Date of all child Opportunities when viewing an Account record.
What would a developer do to meet this requirement?
A. Create a Workflow Rule on the Opportunity object that updates a field on the parent Account.
B. Create a formula field on the Account object that performs a MAX on the Opportunity Close Date field.
C. Create a roll-up summary field on the Account object that performs a MAX on the Opportunity Close Date field
D. Create a trigger on the Account object that queries the Close Date of the most recent Opportunities.
C. Create a roll-up summary field on the Account object that performs a MAX on the Opportunity Close Date field
A developer has the following code.
try { List nameList; Account a; String s = a.Name; nameList.add(s); } catch (ListException le) { System.debug('List Exception'); } catch (NullPointerException npe) { System.debug('NullPointer Exception'); } catch (Exception e) { System.debug('Generic Exception'); }
What message would be logged? A. No message is logged B. Generic Exception C. List Exception D. NullPointer Exception
D. NullPointer Exception
Which statement about change set deployments is accurate?
Choose 3 answers
A. They can be used only between related organizations.
B. They require a deployment connection.
C. They use an all or none deployment model.
D They can be used to transfer Contact records.
E. They can be used to deploy custom settings data.
A. They can be used only between related organizations.
B. They require a deployment connection.
C. They use an all or none deployment model.
A developer wants to list all of the Tasks for each Account on the Account detail page. When a Task is created for a Contact what does the developer need to do to display the Task on the related Account record?
A. Create an Account formula field that displays the Task information.
B. Nothing. The Task is automatically displayed on the Account page.
C. Create a Workflow Rule to relate the Task to the Contact’s Account.
D. Nothing. The Task cannot be related to an Account and a Contact.
B. Nothing. The Task is automatically displayed on the Account page.
Which scenario is invalid for execution by unit tests.
A. Executing methods for negative test scenario.
B. Executing methods as different users.
C. Loading test data in place of user input for Flows.
D. Load the standard Pricebook ID using a system method.
C. Loading test data in place of user input for Flows.
Where can the custom roll-up summary fields be created using Standard Object relationships (Choose 3)
A. On Opportunity using Opportunity Product records.
B. On Account using Case records.
C. On Quote using Order records.
D. On Campaign using Campaign Member records.
E. On Account using Opportunity records.
A. On Opportunity using Opportunity Product records.
D. On Campaign using Campaign Member records.
E. On Account using Opportunity records.
A developer has following query
Contact c = [SELECT Id, FirstName, LastName, Email FROM Contact WHERE LastName = ‘Smith’];
What does the query return if there is no Contact with the last name “Smith”?
A. A Contact with empty values.
B. A Contact initialized to null.
C. An empty List of Contacts.
D. An error that no rows are found.
D. An error that no rows are found.
A Hierarchy Custom Setting stores a specific URL for each profile in Salesforce.
Which statement can a developer use to retrieve the correct URL for the current user’s profile and display this Visualforce Page?
A. {!$Setup.Url_Settings_c.Instance[Profile.Id].URL__c}
B. {!$Setup.Url_Settings_c.URL__c}
C. {!$Setup.Url_Settings_c[Profile.Id].URL__c}
D. {!$Setup.Url_Settings_c[$Profile.Id].URL__c}
B. {!$Setup.Url_Settings_c.URL__c}
A developer writes a SOQL query to find child records for a specific parent
How many specific levels can be returned in a single query?
A.3
B.5
C.1
D.7
C.1
What actions types should be configured to display a custom success message?
A. Update a record.
B. Post a feed item.
C. Delete a record.
D. Close a case.
A. Update a record.
What is the easiest way to verify a user before showing them sensitive content?
A. Sending the user a SMS message with a passcode.
B. Calling the generateVerificationUrl method in apex.
C. Sending the user an Email message with a passcode.s
D. Calling the Session.forcedLoginUrl method in apex.
B. Calling the generateVerificationUrl method in apex.
What features are available when writing apex test classes?
(Choose 2 Answers)
A. The ability to select error types to ignore in the developer console.
B. The ability to write assertions to test after a @future method.
C. The ability to set and modify the CreatedDate field in apex tests.
D. The ability to set breakpoints to freeze the execution at a given point.
E. The ability to select testing data using csv files stored in the system.
C. The ability to set and modify the CreatedDate field in apex tests.
E. The ability to select testing data using csv files stored in the system.
How would a developer determine if a CustomObject__c record has been manually shared with the current user in Apex?
A. By querying the role hierarchy.
B. By calling the isShared() method for the record.
C. By querying CustomObject__Share.
D. By calling the profile settings of the current user.
C. By querying CustomObject__Share.