Topic 2 : Exam Pool B
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 Visualforce page has a standard controller for an object that has a lookup relationship to a parent object. How can a developer display data from the parent record on the page?
A. By adding a second standard controller to the page for the parent record.
B. By using a roll-up formula field on the child record to include data from the parent record.
C. By using SOQL on the Visualforce page to query for data from the parent record.
D. By using merge field syntax to retrieve data from the parent record.
Which standard field needs to be populated when a developer inserts new Contact records programmatically?
A. Accountld
B. Name
C. LastName
D. FirstName
Which Apex collection is used to ensure that all values are unique?
A. A Set
B. An Enum
C. A List
D. An sObject
A developer has a block of code that omits any statements that indicate whether the code block should execute with or without sharing. What will automatically obey the organization-wide defaults and sharing settings for the user who executes the code in the Salesforce organization?
A. Apex Triggers
B. HTTP Callouts
C. Apex Controllers
D. Anonymous Blocks
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 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 < 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
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 URLWhich 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();
Which two number expression evaluate correctly? Choose 2 answers
A. Integer I = 3.14159;
B. Decimal D = 3.14159;
C. Long I = 3.14159;
D. Double D =3.14159;
A developer creates a new Visualforce page and Apex extension, and writes test classes that exercise 95%coverage of the new Apex extension.Change set deployment to production fails with the test coverage warning: "Average test coverage across all Apex classes and triggers is 74%, at least 75% test coverage is required."What can the developer do to successfully deploy the new Visualforce page and extension?
A. Create test classes to exercise the Visualforce page markup.
B. Select "Disable Parallel Apex Testing" to run all the tests.
C. Add test methods to existing test classes from previous deployments.
D. Select "Fast Deployment'' to bypass running all the tests.
Which two queries can a developer use in a visualforce controller to protect against SOQL injection Vulnerabilities? Choose 2 answers
A. String qryName = '%' + String.enforceSecurityChecks(name)+ '%'; String qryString = 'SELECT Id FROM Contact WHERE Name LIKE :qryNAme'; List queryResults = Database.query(qryString);
B. String qryName = '%' + name '%'; String qryString = 'SELECT Id FROM Contact WHERE Name LIKE :qryNAme'; List queryResults = Database.query(qryString);
C. String qryName = '%' + String.escpaeSingleQuotes(name)+ '%'; String qryString = 'SELECT Id FROM Contact WHERE Name LIKE :qryNAme'; List queryResults = Database.query(qryString);
D. String qryString = 'SELECT Id FROM Contact WHERE Name LIKE :qryNAme'; List queryResults = Database.query(qryString);
What are two correct examples of the model in the salesforce MVC architecture? Choose 2 answers.
A. Custom field on the custom wizard_c object
B. Standard lightning component
C. Workflow rule on the contact object
D. Standard account lookup on the contract object
Page 15 out of 33 Pages |
Previous |