Pass the Salesforce Developers PDII Questions and answers with CertsForce

Viewing page 6 out of 6 pages
Viewing questions 51-60 out of questions
Questions # 51:

Given the following containment hierarchy:

What is the correct way to communicate the new value of a property named ‘’passthrough’’ to my-parent-component if the property is defined within my-child-component?

A)

Question # 51

B)

Question # 51

C)

Question # 51

D)

Question # 51

Options:

A.

Option A


B.

Option B


C.

Option C


D.

Option D


Expert Solution
Questions # 52:

Question # 52

What should be added to the setup, in the location indicated, for the unit test above to create the controller extension for the test?

Options:

A.

ApexPages.Standardcontroller sc = new ApexPages. Standardcontroller (acct.Id) ;

AccountControllerExt extension = new AccountControllerExt(sc) ;

om


B.

AccountControllerExt extension = new AccountControllerExt (acct);


C.

ApexPages.StandardController sc = new ApexPages.StandardController(acct);

AccountcontrollerExt extension = new AccountControllerExt(sc);


D.

AccountControllerExt extension = new AccountControllerExt (acct.Id) ;


Expert Solution
Questions # 53:

A developer notices the execution of all the test methods in a class takes a long time to run, due to the initial setup of all the test data that is needed to perform the tests. What should the developer do to speed up test execution?

Options:

A.

Define a method that creates test data and annotate with @testSetup.


B.

Define a method that creates test data and annotate with @createData.


C.

Ensure proper usage of test data factory in all test methods.


D.

Reduce the amount of test methods in the class.


Expert Solution
Questions # 54:

Universal Containers allows customers to log into a Salesforce Community and update their orders via a custom Visualforce page. Universal Containers’ sales representatives can edit the orders on the same Visualforce page.

What should a developer use in an Apex test class to test that record sharing is enforced on the Visualforce page?

Options:

A.

use System. profiles=() to test as a sales rep and a community user.


B.

use System. profiles() to test as an administrator and a community user.


C.

use System. profiles1h=() to test as a sales rep and a community user.


D.

use System. runsAs () to test as an administrator and a community user.


Expert Solution
Questions # 55:

What is the best practice to initialize a Vizualforce page in a test class?

Options:

A.

Use Test. setCurrentPage (Page. MyTeatPage);


B.

Use Test. currantPage .getParamatars put (MyTaestPaga) ;


C.

Use controller. currentPage. setPage (MyTastfage) ;


D.

Use Test. setCurrentPage MyTestPags;


Expert Solution
Questions # 56:

Universal Containers stores user preferences in a Hierarchy Custom Setting, User_Prefs_c, with a Checkbox field, Show_Help_c. Company-level defaults are stored at the organizational level, but may be overridden at the user level. If a user has not overridden preferences, then the defaults should be used.

How should the Show_Help_c preference be retrieved for the current user?

Options:

A.

Boolean show = User_Prefs__c.getValues(UserInfo.getUserId()).Show_Help__c;


B.

Boolean show = User_Prefs__c.getInstance().Show_Help__c;


C.

Boolean show = User_Prefs__c.Show_Help__c;


D.

Boolean show = User_Prefs__c.getValues().Show_Help__c;


Expert Solution
Questions # 57:

A developer implemented a custom data table in a Lightning web component with filter functionality. However, users are submitting support tickets about long load times when the filters are changed. The component uses an Apex method that is called to query for records based on the selected filters.

What should the developer do to improve performance of the component?

Options:

A.

Return all records into a list when the component is created and filter the array In JavaScript.


B.

Use a selective SOQL query with a custom Index.


C.

Use SOSL to query the records on filter change.


D.

Use setstoraclel() in the Apex method to store the response In the client-side cache.


Expert Solution
Questions # 58:

An org records customer order information in a custom object, ordar__c, that has

fields for the shipping address. A developer is tasked with adding code to calculate

shipping charges on an order, based on a flat percentage rate associated with the

region of the shipping address.

What should the developer use to store the rates by region, so that when the changes are deployed to production no additional steps are needed for the calculation to work?

Options:

A.

Custom hierarchy setting


B.

Custom metadata type


C.

Custom list setting


D.

Custom object


Expert Solution
Questions # 59:

Consider the following code snippet:

Question # 59

A developer created the following test class to provide the proper code coverage for the snippet above:

Question # 59

However, when the test runs, no data is returned and the assertion fails.

Which edit should the developer make to ensure the test class runs successfully?

Options:

A.

Implement the without sharing keyword in the searchFeaturs Apex class.


B.

Implement the seeAllData=true attribute in the @1sTest annotation.


C.

Enclose the method call within Test. startbest i) and @Test_stopTast |).


D.

Implement the setFixedSearchResult= method in the test class.


Expert Solution
Questions # 60:

Universal Containers (LIC) wants to develop a customer community to help their customers log issues with their containers. The community needs to function for their German- and Spanish-speaking customers also. UC heard that it's easy to create an international community using Salesforce, and hired a developer to build out the site.

What should the developer use to ensure the site is multilingual?

Options:

A.

Use custom labels to ensure custom messages are translated properly.


B.

Use custom settings to ensure custom messages are translated properly.


C.

Use custom objects to translate custom picklist values.


D.

Use custom metadata to translate custom picklist values.


Expert Solution
Viewing page 6 out of 6 pages
Viewing questions 51-60 out of questions