PDII Free Exam Study Guide! (Updated 169 Questions) [Q63-Q84]

Share

PDII Free Exam Study Guide! (Updated 169 Questions)

PDII Dumps for Salesforce Developers Certified Exam Questions and Answer

NEW QUESTION # 63
Universal Containers (UC) has enabled the translation workbench and has translated picklist values. UC has a custom multi-select picklist field, Product__c, on the Account object that allows sales reps to specify which of UC's products an Account already has. A developer is tasked with writing an Apex method that retrieves Account records, including the Product_c field.
What should the developer do to ensure the value of Products__c is in the current user's language?

  • A. Use the Locale clause in the SOQL query.
  • B. Set the locale on each record in the SOQL result list.
  • C. Call the translate method on each record in the SOQL result list.
  • D. Use tolabel ducts__c) in the fields list of the SOQL query.

Answer: D

Explanation:
To ensure the value of Products__c is in the current user's language, the developer should use toLabel(Products__c) in the fields list of the SOQL query. The toLabel() function converts the picklist values in the query result to the user's language, if the translation workbench is enabled and the values are translated. This way, the developer can display the translated values of the custom multi-select picklist field in the Apex method. Setting the locale on each record in the SOQL result list would not work, as the locale is a user attribute, not a record attribute, and it cannot be changed by Apex code. Calling the translate method on each record in the SOQL result list would not work, as there is no such method in Apex. Using the Locale clause in the SOQL query would not work, as there is no such clause in SOQL. Reference: [Using the toLabel() Function], [Locale Class]


NEW QUESTION # 64
A developer creates an application event that has triggered an infinite loop.
What may have caused this problem?

  • A. An event is fired 'ontouchend'' and is unhandled.
  • B. The event is fired from a custom renderer.
  • C. The event handler calls a trigger.
  • D. The event has multiple handlers registered in the project.

Answer: B

Explanation:
The problem that may have caused an infinite loop when creating an application event is that the event is fired from a custom renderer. A custom renderer is a JavaScript file that overrides the default rendering behavior of a component. If the custom renderer fires an application event, it may trigger a re-rendering of the component or other components that handle the event. This may cause the event to be fired again, creating an infinite loop. The event having multiple handlers registered in the project, the event handler calling a trigger, or an event being fired 'ontouchend' and being unhandled are not likely to cause an infinite loop. Reference: [Application Events], [Custom Renderers]


NEW QUESTION # 65
What is the <apex:actionSupport> tag used for in Visualforce pages?

  • A. To create a Javascript function that can trigger a controller action
  • B. To trigger a second action when a button or link is clicked.
  • C. To provide help and support content for buttons and links.
  • D. To trigger controller actions in response to DOM element events.

Answer: D


NEW QUESTION # 66
Which statement is considered a best practice for writing bulk safe Apex triggers?

  • A. Perform all DML operations from within a future method.
  • B. Use the Database methods with allorNone set to £21s= instead of DML statements.
  • C. Add records to collections and perform DML operations against these collections.
  • D. Add LIMIT 50000 to every SOQL statement.

Answer: C


NEW QUESTION # 67
A developer created a class that implement he Queueable interface, as follows:
As part of the deployment process, the developer is asked to create a corresponding test class.
Which two actions should the developer take to successfully execute the test class?
Choose 2 answers

  • A. Ensure the running user of the test class has, at least, the View All permission on the Order object
  • B. Implement Test.isRunningtest ( ) to prevent chaining jobs during test execution.
  • C. Enclose System.enqueueJob (new orderQueueable Job ( }) within Test. starttest and Test, stoptest ()
  • D. Implement seeAllData-true to ensure the Queueable )ob is able to run in bulk mode.

Answer: A,C


NEW QUESTION # 68
A developer built an Aura component for guests to self-register upon arrival at a front desk kiosk. Now the developer needs to create a component for the utility tray to alert users whenever a guest arrives at the front desk.
What should be used?

  • A. Application Event
  • B. Component Event
  • C. Changelog
  • D. DML Operation

Answer: A


NEW QUESTION # 69
Refer to the following code snippet:

A developer created a JavaScript function as part of a Lightning web component (LWC) that surfaces information about Leads by wire calling geyFetchLeadList whencertain criteria are met.
Which three changes should the developer implement in the Apex class above to ensure the LWC can display data efficiently while preserving security?
Choose 3 answers

  • A. Use the WZ E D clause within the SOQL query.
  • B. Annotate the Apex method with @AuraEnabled(Cacheable=True).
  • C. Annotate the Apex method with @AuraEnabled.
  • D. Implement the with keyword in the class declaration.
  • E. Implement the with sharing keyword in the class declaration.

Answer: B,C,E

Explanation:
The three changes that the developer should implement in the Apex class to ensure the LWC can display data efficiently while preserving security are to annotate the Apex method with @AuraEnabled, implement the with sharing keyword in the class declaration, and annotate the Apex method with @AuraEnabled(Cacheable=True). The @AuraEnabled annotation allows the Apex method to be called from a Lightning web component, and exposes the method to the Lightning Data Service. The with sharing keyword enforces the sharing rules and permissions of the current user when accessing the records, and ensures that the data is secure and compliant. The @AuraEnabled(Cacheable=True) annotation enables the Apex method to be cached by the Lightning Data Service, and improves the performance and efficiency of the data retrieval. Implement the without keyword in the class declaration is not a valid answer, as it ignores the sharing rules and permissions of the current user when accessing the records, and compromises the data security and compliance. Use the WHERE clause within the SOQL query is not a valid answer, as it is not a change in the Apex class, and it does not affect the security or efficiency of the data display. Reference: [Call Apex Methods], [Using the with sharing or without sharing Keywords], [Improve Performance with Storable Actions], [Apex Developer Guide]


NEW QUESTION # 70
Which two relationship queries use the proper syntax? (Choose two.)

  • A. 'Media'
    SELECT Name, (SELECT LastName FROM Contacts__r) FROM Account
  • B. SELECT Id, Name, Account.Name FROM Contact WHERE Account.Industry = 'Media'
  • C. SELECT Id, Name, Account__r.Name FROM Contact WHERE Account__r.Industry
  • D. SELECT Name, (SELECT LastName FROM Contacts) FROM Account

Answer: B,D


NEW QUESTION # 71
What is the correct syntax for calling a controller action from a Visualforce page and updating part of the page once the action is completed? (Choose two.)

  • A. <apex: actionFunction action=" { ! Save} " name=!,Save" rerender=l,thePageBlock1'/>
  • B. <apex: actionSupport action="{ ISave} " event=llonchange1' rerender="thePageBlock"/>
  • C. <apex : commandFunction action=?l { ! Save} " value="Save" rendered^"thePageBlock"/>
  • D. <apex:commandButton action="{!Save}" value="Save" redraw="thePageBlock"/>

Answer: A,B


NEW QUESTION # 72
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?

  • A. Ensure proper usage of test data factory in all test methods.
  • B. Reduce the amount of test methods in the class.
  • C. Define a method that creates test data and annotate with @testSetup.
  • D. Define a method that creates test data and annotate with @createData.

Answer: C


NEW QUESTION # 73
Choose the correct definition for <apex:actionStatus>

  • A. Can be associated with an AJAX request (actionFunction/actionSupport/actionPoller) and shows content conditionally depending on the status of the request (in progress/complete). Use the "id" field to specify name; use "status" field on related components to connect them
  • B. Adds AJAX support to another component (e.g. onClick, onMouseUp, onFocus, etc.)
  • C. Allows for controller methods to be called directly from Javascript. Must be encapsulated in
    <apex:form> tags. Unlike actionSupport, these function<apex:actionPoller>s can be called directly from Javascript code
  • D. Sends an AJAX request according to the time interval you specify. If this ever gets re-rendered, it resets
  • E. Signifies which components should be processed by the server when an AJAX request is generated

Answer: A


NEW QUESTION # 74
Which two relationship queries use the proper syntax? Choose 2 answers

  • A. SELECT Id, Name, Account.Name FROM Contact WHERE Account.Industry = 'Media'
  • B. SELECT Name, (SELECT LastName FROM Contacts__r) FROM Account
  • C. SELECT Name, (SELECT LastName FROM Contacts) FROM Account
  • D. SELECT Id, Name, Account __r.Name FROM Contact WHERE Account r.Industry = 'Media'

Answer: B,C


NEW QUESTION # 75
Which tag should a developer use to display different text while
an <apex:commandButton> is Processing an action?

  • A. <apex:actionitatua>
  • B. <apex:actionPaller>
  • C. <apex:pageMes sagas
  • D. <apex:actionSupparts

Answer: D

Explanation:
apex:actionSupport is a tag that should be used to display different text while an apex:commandButton is processing an action. apex:actionSupport is a component that can be used to add AJAX support to other components, such as buttons, links, or input fields. apex:actionSupport can specify an action to be executed, an event to trigger the action, and a rerender attribute to update a part of the page. By using apex:actionSupport inside an apex:commandButton, the developer can display different text while the button is processing the action, such as "Processing..." or "Please wait...". For example, the developer can use the following code to display different text while the button is processing the action:
<apex:commandButton value="Submit" action="{!submit}"> <apex:actionSupport event="onclick" rerender="buttonText"/> <apex:facet name="caption"> <apex:outputPanel id="buttonText"> <apex:outputText value="Processing..." rendered="{!processing}"/> <apex:outputText value="Please wait..." rendered="{!NOT(processing)}"/> </apex:outputPanel> </apex:facet> </apex:commandButton>


NEW QUESTION # 76
A Lightning Component has a section that displays some information about an Account and it works well on the desktop, but users have to scroll horizontally to see the Description field output on their mobile devices and tablets.

Which option has the changes to make the component responsive for mobile and tablet devices?

  • A.
  • B.
  • C.
  • D.

Answer: C


NEW QUESTION # 77
Which type of controller is best suited when you want all of the basic DML functions from an object's normal new/edit page?

  • A. Controller Extensions
  • B. Standard List/Set Controller
  • C. Standard Controller
  • D. Custom Controller

Answer: B


NEW QUESTION # 78
A developer has requirement to query three fields (id, name, Type) from an Account and first and last names for all Contacts associated with the Account.
Which option is the preferred optimized method to achieve this for the Account named 'Ozene Electronics'?

  • A. Account a = (SELECT ID, Name, Type from Account where name= Ozone Electronics;) list 1contacts = (SELECT firstname, lastname from Contacts where accountid=: a -ID0;
  • B. List 1Contacts = new list ( );
    for(Contact c ; 1Select firstname, lastname Account, Name Account,ID Account, Type from Contact where Account: Name=' electronics')) ( iContacts.add(c);)
  • C. List 1Accounts = (Select ID, Name, Type from Account Join (Select ID, firstname, lastname form Contact where contact account , name 'ozone electronics));
  • D. Account a = (SELECT ID, Name, Type, (select contat,firstName, Contact,LastName from Account, Contacts) from Account where name; Ozone Electronic' Limit 1 );

Answer: D


NEW QUESTION # 79
A developer is creating a Lightning web component to display a calendar. The component will be used in multiple countries. In some locales, the first day of the week is a Monday, or a Saturday, or a Sunday.
What should the developer do to ensure the calendar displays accurately for users in every locale?

  • A. Use a custom metadata type to store key/value pairs.
  • B. Use Userinfor. getLocale () in the component.
  • C. Import the firstDayofWeek property in the component.
  • D. Query the FirstDayOfweek field from the Locale for the current user.

Answer: B


NEW QUESTION # 80
Consider the following code snippet:

The Apex method is executed in an environment with a large data volume count for Accounts, and the query is performing poorly.
Which technique should the developer implement to ensure the query performs optimally, while preserving the entire result set?

  • A. Create a formula field to combine the CreateData and RecordType value, then Piter based on the formula.
  • B. Annotate the method w'th the @Future annotation.
  • C. Use the Database, queryLocation method to retrieve the accounts.
  • D. Break down the query into two individual queries and join the two result sets.

Answer: D


NEW QUESTION # 81
Refer to the test method below''

The test method calls a web service that updates an external system with Account information and sets the Accounts integration_Updated__c checkbox to True when it completes.
The test fails to execute and exits with an error: "Methods defined as TestMethod do not support Web service callouts."

  • A.
  • B.
  • C.
  • D.

Answer: D


NEW QUESTION # 82
What is the transaction limit for the number of records for SOSL?

  • A. There is no limit
  • B. 0
  • C. 200 (synchronous), 100 (async)
  • D. 100 (synchronous), 200 (async)
  • E. 2,000

Answer: E

Explanation:
Explanation


NEW QUESTION # 83
Consider the queries in the options below and the following Information:
* For these queries, assume that there are more than 200,000 Account records.
* These records Include soft-deleted records; that is, deleted records that are still in the Recycle Bin.
* There are two fields that are marked as External Id on the
Account. These fields are customer_Number_c and ERR_Key_ s.
Which two queries are optimized for large data volumes?
Choose 2 answers

  • A. SELECT ID FROM Account WHRE id IN :aListVariable
  • B. SELECT I4 FROM Account WHERE Name != NULL
  • C. SELECT Id FROM Account WHERE Name != ' 'AND IsDeleted = false
  • D. SELECT 1d FROM Accounts WHERE Name != '' AND Customer_Number_c- "ValueA'

Answer: A,D

Explanation:
The two queries that are optimized for large data volumes are: SELECT Id FROM Account WHERE Name != '' AND Customer_Number__c = 'ValueA', and SELECT Id FROM Account WHERE Id IN :aListVariable. An optimized query for large data volumes is a query that filters the records based on an indexed field or a field that has high selectivity. An indexed field is a field that has an index created by the system or the user to speed up the query performance. A field has high selectivity if the filter value in the query matches a low percentage of the total number of records for that object. The Customer_Number__c and Id fields are indexed fields, as they are custom fields that are marked as External Id, which creates an index. The Name field is also an indexed field, except when it is used with the LIKE operator. The != operator and the IN operator are selective operators, as they filter the records based on exact or list values, which can improve the selectivity. The AND operator allows the query to combine multiple filters, which can also improve the selectivity. The query SELECT Id FROM Account WHERE Name LIKE '!-NULL' is not an optimized query for large data volumes, as the LIKE operator with a wildcard character (%) at the beginning of the filter value is not selective, and the Name field is not indexed when used with the LIKE operator. The query SELECT Id FROM Account WHERE Name != '' AND IsDeleted = false is not an optimized query for large data volumes, as the IsDeleted field is not an indexed field, and the false value is not a selective value, as it matches a high percentage of the records. Reference: [Working with Very Large SOQL Queries], [Custom Field Attributes]


NEW QUESTION # 84
......

Use Real PDII Dumps - 100% Free PDII Exam Dumps: https://lead2pass.examdumpsvce.com/PDII-valid-exam-dumps.html