[Nov 21, 2024] Fully Updated Free Actual Salesforce PDII Exam Questions Free PDII Questions for Salesforce PDII Exam [Nov-2024] Salesforce PDII Certification Exam requires candidates to have a deep understanding of Salesforce development concepts and best practices. Candidates must be proficient in Apex, Visualforce, and Lightning components, as well as have experience with Salesforce integrations [...]

[Nov 21, 2024] Fully Updated Free Actual Salesforce PDII Exam Questions [Q36-Q58]

Share

[Nov 21, 2024] Fully Updated Free Actual Salesforce PDII Exam Questions

Free PDII Questions for Salesforce PDII Exam [Nov-2024]


Salesforce PDII Certification Exam requires candidates to have a deep understanding of Salesforce development concepts and best practices. Candidates must be proficient in Apex, Visualforce, and Lightning components, as well as have experience with Salesforce integrations and security mechanisms. Candidates who pass the PDII Certification Exam will have demonstrated their ability to design and develop complex applications that meet the specific needs of Salesforce customers.


Salesforce PDII certification is recognized as a valuable credential in the Salesforce community. It is a testament to a developer's expertise in building complex solutions on the Salesforce platform. Having this certification can enhance a developer's career opportunities and increase their earning potential.

 

NEW QUESTION # 36
Business rules require a Contact to always be created when a new Account is created. What can be used when developing a custom screen to ensure an Account is not created if the creation of the Contact fails?

  • A. use setSavePoint() and rollback() with a try/catch block.
  • B. use the Database.Insert method with allOrNone set to False.
  • C. use the Database.Delete method if the Contact insertion fails.
  • D. Disable validation rules on Contacts and set default values with a Trigger.

Answer: A


NEW QUESTION # 37
JavaScript remote actions need be either a _______ or _______ class and must be _______.

  • A. Public or TestVisible and must be static.
  • B. Public or global and must be static.
  • C. Private or global and must be static.

Answer: B


NEW QUESTION # 38

Consider the above trigger intended to assign the Account to the manager of the Account''s region. Which two changes should a developer make in this trigger to adhere to best practices? Choose 2 answers

  • A. Remove the last line updating accountList as it is not needed.
  • B. Move the Region__c query to outside the loop.
  • C. Use a Map accountMap instead of List accountList.
  • D. Use a Map to cache the results of the Region__c query by Id.

Answer: C,D


NEW QUESTION # 39
A custom field Exec_Count_c of type Number is created on an Account object. An account record with value of "1" for a: Exec_Count_c is saved. A workflow field update is defined on the Exec_Count_c field, to increment its value every time an account record is created or updated. The following trigger is defined on the account: trigger ExecOrderTrigger on Account (before insert, before update, after insert, after update) { for (Account accountInstance: Trigger.New) { if (Trigger . isBefore) { accountInstance . Exec_Count_c +=l; System. debug (accountInstance . Exec_Count_c); } } } What is printed from the System.debug statement?
Output from System.debug in every iteration is separated with a delimiter.

  • A. 1,2,3,4
  • B. 2,2,4,4
  • C. 2,2,3,3
  • D. 1,2,3,3

Answer: B


NEW QUESTION # 40
A developer is asked to build a solution that will automatically send an email to the Customer when an Opportunity stage changes. The solution must scale to allow for 10,000 emails per day. The criteria to send the email should be evaluated after all Workflow Rules have fired. What is the optimal way to accomplish this?

  • A. Use an Email Alert with Process Builder.
  • B. Usea MassEmailMessage() with an Apex Trigger.
  • C. Use a Workflow Email Alert.
  • D. Use a SingleEmailMessage() with an Apex Trigger.

Answer: A


NEW QUESTION # 41
An org has a requirement that an Account must always have one and only one Contact listed as Primary. So selecting one Contact will de-select any others. The client wants a checkbox on the Contact called 'Is Primary' to control this feature.
The client also wants to ensure that the last name of every Contact is stored entirely in uppercase characters.
What is the optimal way to implement these requirements?

  • A. Write an after update trigger on Account for the Is Primary logic and a before update trigger on Contact for the last name logic.
  • B. Write an after update trigger on Contact for the Is Primary logic and a separate before update trigger on Contact for the last name logic.
  • C. Write a single trigger on Contact for both after update and before update and callout to helper classes to handle each set of logic.
  • D. Write a Validation Rule on the Contact for the Is Primary logic and a before update trigger on Contact for the last name logic.

Answer: C

Explanation:
A single trigger on Contact that handles both after update and before update events, utilizing helper classes for each logic set, is the most optimal implementation. It centralizes the logic for maintaining primary contacts and normalizing last names while allowing for clear separation of concerns through helper classes.References:
Apex Developer Guide - Triggers


NEW QUESTION # 42
Consider the following code snippet:

Choose 2 answers

  • A. Store the URL of the endpoint in a custom Label named endpointURL.
  • B. Use reg.setEndpoint(Label.endPoinrURL);,
  • C. Create a Named Credential, endpoint_NC, to store the endpoint and credentials.
  • D. Use req.setEndpoint,calloat;eodPolat NC'); within the callout request.

Answer: A,D

Explanation:
The two changes that the developer should implement in the Apex class to ensure the LWC can display data efficiently while preserving security are to store the URL of the endpoint in a custom Label named endpointURL, and to use req.setEndpoint('callout:endpoint_NC'); within the callout request. Storing the URL of the endpoint in a custom Label allows the developer to avoid hard-coding the URL in the Apex code, and to manage the URL value from the Setup menu. This makes the code more maintainable and flexible, and also prevents exposing the URL to unauthorized users. Using req.setEndpoint('callout:endpoint_NC'); within the callout request allows the developer to use a Named Credential to store the endpoint and the credentials for the external system. This simplifies the authentication process, and also ensures that the credentials are secure and encrypted. The setEndpoint() method accepts a callout: prefix followed by the name of the Named Credential to use for the callout request. The getSubjectType() method is not a valid answer, as it is used to get the subject type of a Platform Event, but it does not affect the efficiency or security of the data display. The WHERE clause is not a valid answer, as it is used to filter the records in a SOQL query, but it does not affect the efficiency or security of the data display. Reference: [Custom Labels], [Named Credentials], [Apex Developer Guide]


NEW QUESTION # 43
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 has multiple handlers registered in the project.
  • D. The event handler calls a trigger.

Answer: B


NEW QUESTION # 44
A developer needs to create a Lightning page for entering Order Information. An error message should be displayed if the zip code entered as part of the Order's shipping address is not numeric.
What is a recommended way for the error message be displayed to the end user?

  • A. Use the ui:outputText tag to display errors
  • B. Use the apex:message tag to display errors
  • C. Use the ui:inputDefaultError tag to display errors
  • D. Use the aura:component tag to display errors

Answer: C


NEW QUESTION # 45
An Apex trigger creates a Contract record every time an Opportunity record is marked as Closed end Won. This trigger is working great, except (due to a recent acquisition) historical Opportunity records need to be loaded into the Salesforce instance.
When a test batch of records are loaded, the Apex trigger creates Contract records. A developer is tasked with preventing Contract records from being created when mass loading the Opportunities, but the daily users still need to have the Contract records created.
What is the most extendable way to update the Apex trigger to accomplish this?

  • A. Add a Validation Rule to the Contract to prevent Contract creation by the user who loads the data.
  • B. Use a List Custom Setting to disable the trigger for the user who loads the data.
  • C. Use a Hierarchy Custom Setting to skip executing the logic inside the trigger for the user who loads the data.
  • D. Add the Profile ID of the user who loads the data to the trigger so the trigger will not fire for this user.

Answer: C


NEW QUESTION # 46
REST uses __________.

  • A. The HTTPRequest class
  • B. The HTTP class
  • C. The HTTPResponse class
  • D. All of the above

Answer: D

Explanation:
CalloutException happens if an error occurs Classes begin with @RestResource(urlMapping='/yourUrl'), and methods can have annotations such as @HttpGet, @HttpPost, etc


NEW QUESTION # 47
A developer wrote a class named asccuntRisteryManager that relies on field history tracking. The class has a static method called getaccountHistory that Lakes in an Account as a parameter and returns a list of associated accountHistory object records.
The following test fails:

What should be done to make this test pass?

  • A. Use @isTest (SeeAllData=true] to see historical data from the org and query for Accountdistory records.
  • B. The tact method should he delated since this code cannat be tested
  • C. Use Test. isRunningTest (] in getAccountHistory() to conditionally return fake AccountHistory records.
  • D. Create Accountdistory records manually in the test setup and write a query to get them.

Answer: C


NEW QUESTION # 48
In which of the following scenarios would it be acceptable to use programmatic sharing instead of declarative sharing? (Choose three.)

  • A. Every record created by sales users needs to be visible to their respective manager
  • B. There is an existing, external system of truth for user access assignments which will continue to drive access and be integrated with salesforce
  • C. Team functionality is required on custom objects
  • D. Poor performance when using native sharing components
  • E. You need to change record access to read/write for all users utilising a lightning component

Answer: B,C,D


NEW QUESTION # 49
A company has a custom component that allows users to search for records of a certain object type by invoking an Apex Controller that returns a list of results based on the user's input. When the search is completed, a searchComplete event is fired, with the results put in a results attribute of the event. The component is designed to be used within other components and may appear on a single page more than once.
What is the optimal code that should be added to fire the event when the search has completed?

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

Answer: C


NEW QUESTION # 50
When the sales team views an individual customer record, they need to see recent interactions for the customer. These interactions can be sales orders, phone cats, or Cases. The date range for recent interactions will be recent for every customer record type.
How can this be accomplished?

  • A. Use batch Apex to query for the most recent interactions when the customer view screen is loaded.
  • B. Use Lightning Flow to read the customer's record type, and then do a dynamic Query for recent interactions and display on the View page.
  • C. Use a dynamic form on the customer record page to display recent interactions.
  • D. Use a Lightning component to query and display interactions based on record type that is passed in using a design: attribute from the Lightning page.

Answer: B


NEW QUESTION # 51
Employee_c is a Child object of Company_c. The Company_c object has an external Id field Company_ld_c.
How can a developer insert an Employee_c record linked to Company_c with a Company_ld_c of '999'?

  • A. Employee_c emp = new Employee_c(Name=fDeveloperf); emp.Company_r = new Company _ r(Company Id c=f999f) insert emp;
  • B. Employee_c emp = new Employee_c(Name=fDeveloperT); emp. Company_c = new Company_c(Company_Id_c=f 999 T) insert emp;
  • C. Employee_c emp = new Employee_c(Name=fDeveloperf); emp.Company_c = f999f insert emp;
  • D. Employee_c emp = new Employee_c(Name=fDeveloperf); emp.Company_r = f999f insert emp;

Answer: A


NEW QUESTION # 52
A developer is tasked with ensuring that email addresses entered into the system for Contacts and for a Custom Object called Survey_Response_ _c do not belong to a list of blocked domains. The list of blocked domains will be stored in a custom object for ease of maintenance by users. Note that the Survey_Response_ _c object is populated via a custom Visualforce page.
What is the optimal way to implement this?

  • A. Implement the logic in an Apex trigger on Contact and also implement the logic within the Custom Visualforce page controller
  • B. Implement the logic in the Custom Visualforce page controller and call that method from an Apex trigger on Contact
  • C. Implement the logic in a helper class that is called by an Apex trigger on Contact and from the Custom Visualforce page controller
  • D. Implement the logic in a Validation Rule on the Contact and a Validation Rule on the Survey_Response_ _c object

Answer: C


NEW QUESTION # 53
A developer needs to implement a system audit feature that allows users, assigned to a custom profile named
"Auditors", to perform searches against the historical records in the Account object. The developer must ensure the search is able to return history records that are between 6 and 12 months old.
Given the code below, which select statement should be inserted below as a valid way to retrieve the Account History records ranging from 6 to 12 months old?

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

Answer: C

Explanation:
Given the code snippet, the correct query to retrieve Account History records between 6 and 12 months old would be the one that includes a WHERE clause filtering records where the CreatedDate is greater than or equal to initialDate and less than or equal to endDate. Option B's statement does this correctly by using the >
= and <= operators to define the range between initialDate (which is set to today's date minus 12 months) and endDate (set to today's date minus 6 months). Options A, C, and D either use incorrect comparison operators or compare against the wrong variables, resulting in an incorrect data set being returned.
References
SOQL Date Formats and Date Literals: SOQL and SOSL Reference Guide


NEW QUESTION # 54
What is a recommended practice with regard to the Apex CPU limit? Choose 2 answers

  • A. Use Map collections to cache sObjects.
  • B. Optimize SOQL query performance.
  • C. Reduce view state in Visualforce pages.
  • D. Avoid nested Apex iterations.

Answer: A,D


NEW QUESTION # 55
Choose the correct definition for <apex:actionPoller>.

  • A. Adds AJAX support to another component (e.g. onClick, onMouseUp, onFocus, etc.)
  • B. 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
  • C. Signifies which components should be processed by the server when an AJAX request is generated
  • D. 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
  • E. Sends an AJAX request according to the time interval you specify. If this ever gets re-rendered, it resets

Answer: E


NEW QUESTION # 56
What is the correct order of execution for Visualforce Page "get" requests (initial page visit)

  • A. 1) Evaluate constructors on controller and extensions
    2) Evaluate constructors, extensions, and expression on attribute definitions on any custom components present
    3) Evaluate expressions, <apex:page> attribute actions, and other method calls (getters/setters) on main page
    4) If there's a <apex:form> element, create the view state
    5) Send HTML to Browser
  • B. 1) Evaluate constructors, extensions, and expression on attribute definitions on any custom components present
    2) Evaluate constructors on controller and extensions
    3) Evaluate expressions, <apex:page> attribute actions, and other method calls (getters/setters) on main page
    4) If there's a <apex:form> element, create the view state
    5) Send HTML to Browser
  • C. 1) Evaluate constructors on controller and extensions
    2) If there's a <apex:form> element, create the view state
    3) Evaluate expressions, <apex:page> attribute actions, and other method calls (getters/setters) on main page
    4) Evaluate constructors, extensions, and expression on attribute definitions on any custom components present
    5) Send HTML to Browser

Answer: A


NEW QUESTION # 57
Assuming the CreateOneAccount class creates one account and implements the Queueable interface, which syntax properly tests the Apex code?

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

Answer: D

Explanation:
To test Queueable Apex, Test.startTest() and Test.stopTest() should be used to ensure the asynchronous code is executed before assertions are made. After calling Test.stopTest(), you would then query for the records to assert that the queueable job correctly created the Account records.References: Apex Developer Guide - Testing Asynchronous Apex


NEW QUESTION # 58
......

Validate your PDII Exam Preparation with PDII Practice Test: https://www.guidetorrent.com/PDII-pdf-free-download.html

Get all the Information About Salesforce PDII Exam 2024 Practice Test Questions: https://drive.google.com/open?id=1SmG2TM3gy92roSls6Ykbroqbz2eDFoTU