PDII Practice Exams and Training Solutions for Certifications [Q87-Q105]

Share

PDII Practice Exams and Training Solutions for Certifications

Dumps Free Test Engine Player Verified Answers


Salesforce Certified Platform Developer II (PDII) certification exam is an advanced-level certification that validates a developer's expertise in building complex applications on the Salesforce platform. It is a valuable credential for developers who want to showcase their skills and expertise in the Salesforce ecosystem. By passing the PDII certification exam, developers can demonstrate their ability to design and implement complex business logic, data models, and custom user interfaces using Apex, Visualforce, and other advanced features of the Salesforce platform.


Salesforce PDII exam is a challenging yet rewarding certification that validates advanced knowledge and skills in Salesforce development. It is a key credential for developers who want to advance their careers in Salesforce and work on complex projects that require advanced skills and knowledge. With the right preparation and dedication, candidates can pass the exam and join the ranks of certified Salesforce experts.


The PDII certification exam is a comprehensive exam that covers a wide range of topics related to Salesforce development. Some of the key topics covered in the exam include Apex code development, data modeling and management, integration with external systems, security and access control, and user interface design. PDII exam is designed to evaluate the candidate’s knowledge and expertise in these areas and their ability to apply that knowledge to real-world scenarios.

 

NEW QUESTION # 87
Universal Containers uses Big Objects to store almost a billion customer transactions called Customer_Transaction__b.
These are the fields on Customer_Transaction__b:
Account__c
Program__c
Points_Earned__c
Location__c
Transaction_Date__c
The following fields have been identified as Index Fields for the Customer_Transaction__b object: Account__c, Program__c, and Transaction_Date__c.
Which SOQL query is valid on the Customer_Transaction__b Big Object?

  • A. SELECT Account__c, Program__c, Transaction_Date__c
    FROM Customer_Transaction__b WHERE Account__c = '001R000000302D3'
    AND Program__c LIKE 'Shop%'
    AND Transaction_Date__c=2019-05-31T00:00Z
  • B. SELECT Account__c, Program__c, Transaction_Date__c FROM Customer_Transaction__b WHERE Account__c = '001R000000302D3' AND Program__c ='Shoppers' AND Transaction_Date__c=2019-05-31T00:00Z
  • C. SELECT Account__c, Program__c, Transaction_Date__c FROM Customer_Transaction__b WHERE Account__c = '001R000000302D3' AND Program__c INCLUDES ('Shoppers', 'Womens') AND Transaction_Date__c=2019-05-31T00:00Z
  • D. SELECT Account__c, Program__c, Transaction_Date__c FROM Customer_Transaction__b WHERE Account__c = '001R000000302D3' AND Program__c EXCLUDES ('Shoppers', 'Womens') AND Transaction_Date__c=2019-05-31T00:00Z

Answer: B


NEW QUESTION # 88
A developer is trying to decide between creating a Visualforce component or a Lightning component for a custom screen.
Which functionality consideration impacts the final decision?

  • A. Does the screen need to be rendered as a PDF without using a thirdparty application?
  • B. Does the screen need to be accessible from the Lightning Experience UI?
  • C. Will the screen be accessed via a mobile app?
  • D. Will the screen make use of a JavaScript framework?

Answer: A

Explanation:
Visualforce has a built-in feature to render a page as a PDF by using the renderAs attribute. This feature allows the developer to create PDF documents from Visualforce pages without using any third-party applications or libraries. Lightning components do not have this feature, and would require the use of external services or libraries to generate PDF documents from the component. Therefore, if the screen needs to be rendered as a PDF without using a third-party application, the developer should choose Visualforce over Lightning. Reference: [Rendering a Page as a PDF], [Creating PDFs with Lightning Components]


NEW QUESTION # 89
Consider the controller code above that is called from a Lightning component and returns data wrapped in a class.

Consider the controller code above that is called from a Lightning component and returns data wrapped in a class.
The developer verified that the Queries return a single record each and there is error handing in the Lightning component, but the component is not getting anything back when calling the controller getSomeData().
What is wrong?

  • A. The member's Name and Option should not have getter and setter.
  • B. Instances of Apex classes such as MyDataWrapper cannot be returned to a Lightning component.
  • C. The member's Name and Option should not be declared public.
  • D. The member's Name and Option of the class MyDataWrapper should be annotated with @AuraEnabled too.

Answer: D


NEW QUESTION # 90
Global with sharing class MyRemoter { public String accountName { get; set; } public static Account account { get; set; } public AccountRemoter(} {} @RemoteAction global static Account getAccount (String acccuntName) { account = [SELECT Id, Name, NumberOfEmployees FROM Account WHERE Name = :accountName]; return account; } } Consider the Apex class above that defines a RemoteAction used on a Visualforce search page. Which code snippet will assert that the remote action returned the correct Account?

  • A. Account a = controller.getAccount('TestAccount');
    System.assertEquals(, 'TestAccount', a.Name } ;
  • B. Account a = MyRemoter.getAccount ('TestAccount'):
    System.assertEquals{ 'TestAccount', a.Name };
  • C. MyRemoter remote = new MyRemoter();
    Account a = remote.getAccount ({'TestAccount');
    System.assertEquals, 'TestAcccunt', a.Name -;
  • D. MyRemoter remote = new MyRemoter('TestAccount'};
    Account a = remote.getAccount {);System.assertEquals(, ''TestAccount', a.Name -;

Answer: B


NEW QUESTION # 91
A developer needs to design a custom object that will be integrated into a back-end system. What should the developer do to ensure good data quality and to ensure that data imports, integrations, and searches perform well? Choose 2 answers

  • A. Configure a custom field as external ID.
  • B. Configure a custom field as Salesforce ID.
  • C. Configure a custom field as unique.
  • D. Configure a custom field as indexed.

Answer: A,C


NEW QUESTION # 92
Choose the correct definition for <apex:message>

  • A. A single message, without formatting, that can be associated with a specific component on the page
  • B. Standard Salesforce formatting, throws a specific message on a page
  • C. No formatting; displays all errors on a page
  • D. Standard Salesforce formatting, shows all errors that occur on page. Can add more messages through the
    "ApexPages.addMessage" function

Answer: C


NEW QUESTION # 93
A developer wants to write a generic Apex method that will compare the Salesforce Name field between any two object records. For example, to compare the Name field of an Account and an Opportunity; or the Name of an Account and a Contact. Assuming the Name field exists, how should the developer do this?4

  • A. Invo13ke a Schema.describe() function to compare the14 values of each Name field.
  • B. Cast each object into an sObject and use sObject.get('Name') to compare the Name fields.1112
  • C. Use the Salesforce Metadata API to extrac8t the value of each object and compare the Name fields.910
  • D. Use a String.replace() method to parse the contents of each Name field and then compare the results.567

Answer: B

Explanation:
To write "generic" code in Apex-meaning code that can handle different types of objects (Accounts, Contacts, Custom Objects) interchangeably-the developer should use the base sObject class. All Salesforce objects inherit from this base class.
The sObject class provides a method called .get(fieldName) (Option C). This method allows you to retrieve the value of any field by passing its string name as an argument. By casting the input records (e.g., an Account and an Opportunity) to the generic sObject type, the developer can call .get('Name') on both and compare the returned objects (typically strings). This bypasses the need to know the specific object type at compile-time and avoids complex conditional logic.
Option A is incorrect because String.replace is for string manipulation, not data retrieval. Option B is incorrect because the Metadata API is for modifying org structure, not retrieving record field values. Option D is incorrect because Schema.describe provides information about the field's definition (type, label, length), but it does not provide the actual data value stored in a specific record. Using the generic sObject.get() method is the standard, most efficient way to achieve polymorphism in Apex data handling.


NEW QUESTION # 94
Which of the following elements can be members of a public group? Choose 3

  • A. Profiles
  • B. Users
  • C. Roles
  • D. Territories
  • E. Case Teams

Answer: B,C,D


NEW QUESTION # 95
A company has many different unit test methods that create Account records as part of their data setup. A new required field was added to the Account and now all of the unit tests fail.
What is the optimal way for a developer to fix the issue?

  • A. Add the required field to the data setup for all of the unit tests.
  • B. Add a before insert trigger on Account to set the value of the required field,
  • C. Change the required field to be a validation rule that excludes the System Administrator profile.
  • D. Create a TestDataFactory class that serves as the single place to create Accounts for unit tests and set the required field there.

Answer: D

Explanation:
The optimal way to fix the failing unit tests after adding a new required field to the Account object is to create a TestDataFactory class that serves as a centralized place to create Accounts for unit tests. This class would include the new required field, ensuring that all unit tests have the necessary data setup.References: Apex Developer Guide - Using a Test Data Factory


NEW QUESTION # 96
Refer to the code snippet below:

A custom object called Credit_Memo__c exists in a Salesforce environment. As part of a new feature development that retrieves and manipulates this type of record, the developer needs to ensure race conditions are prevented when a set of records are modified within an Apex transaction.
In the preceding Apex code, how can the developer alter the query statement to use SOQL features to prevent race conditions within a transaction?

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

Answer: B

Explanation:
To prevent race conditions during an Apex transaction, the SOQL query can be modified to include the "FOR UPDATE" keyword. This keyword locks the records that are returned by the query, preventing other transactions from modifying them until the current transaction is complete. This ensures that the retrieved records cannot be changed by another process before the current transaction is completed, thus preventing race conditions. The correct option to use in the code snippet provided is:
[SELECT Id, Name, Amount__c FROM Credit_Memo__c WHERE Customer_Id__c = :customerId LIMIT
50 FOR UPDATE]
This will lock up to 50 records of Credit_Memo__c with the specified Customer_Id__c for the duration of the transaction.
References:
FOR UPDATE
Preventing Record Update Conflicts


NEW QUESTION # 97
A company has code to update a Request and Request Lines and make a callout to their external ERP system's REST endpoint with the updated records.

The callousUtil.makeRestCallout fails with a "You have uncommitted work pending. Please commit or rollback before calling cut' error.
What should be done to address the problem?

  • A. Change the callousUtil makeRestCallout to an @InvocsblsMethod method.
  • B. Remove the Database. setSavepoint and Database. rollback.
  • C. Change the CallousUtill .makeRestCallout to an @future method.

Answer: C

Explanation:
Changing the CalloutUtil.makeRestCallout to an @future method is a way to address the problem of the "You have uncommitted work pending. Please commit or rollback before calling out" error. This error occurs when a DML operation is performed before a callout to an external service, such as a REST endpoint. This is because the DML operation locks the database records and prevents them from being rolled back if the callout fails. To avoid this error, the developer can use the @future annotation to mark the CalloutUtil.makeRestCallout method as asynchronous, which means it will run in a separate thread after the DML operation is committed. This way, the DML operation and the callout will not interfere with each other, and the error will be resolved. Reference: [Asynchronous Apex], [Making Callouts]


NEW QUESTION # 98
Given the following information regarding Universal Containers (UC):
* UC represents their customers as Accounts in Salesforce.
* All customers have a unique Customer__Number_c that is unique across all of UC's systems.
* UC also has a custom Invoice c object, with a Lookup to Account, to represent invoices that are sent out from their external system.
UC wants to integrate invoice data back into Salesforce so Sales Reps can see when a customer pays their bills on time.
What is the optimal way to implement this?

  • A. Query the Account Object upon each call to insert invoice data to fetch the Salesforce ID corresponding to the Customer Number on the invoice.
  • B. Create a cross-reference table in the custom invoicing system with the Salesforce Account ID of each Customer and insert invoice data nightly,
  • C. Use Salesforce Connect and external data objects to seamlessly import the invoice data into Salesforce without custom code.
  • D. Ensure Customer Number cis an External ID and that a custom field Invoice Number cis an External ID and Upsert invoice data nightly.

Answer: D


NEW QUESTION # 99
The Salesforce instance at Universal Containers currently integrates with a third-party company to validate mailing addresses via REST services. The third-party address verification system recently changed endpoint URLs for all their set vices from https://th-addreaa-service.3pc.com to https://plc1-mailsarvice.3pc.com. Everything else remained the same. The developer updated code to reflect this endpoint change, but the mailing address validation service stopped working after the change.
What else should be done to complete this web service end point change?

  • A. Add web service IP Addresses to Trusted IP Ranges m the Network Access security controls settings.
  • B. Create a new Remote Site for the new endpoint URL.
  • C. Test the callout property using HttpCalloutMock.
  • D. Use a Custom Setting with the new endpoint Instead of hard coding the URL.

Answer: B


NEW QUESTION # 100
The Salesforce admin et Cloud Kicks created a custom object called Region_c to store all postal zip codes in the United States and the Cloud Kicks sales region the zip code belongs to.

Cloud Kicks wants a trigger on the Lead to populate the Region based on the Lead's zip code.
Which code segment is the most efficient way to fulfill this request?

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

Answer: C


NEW QUESTION # 101
A Lightning web component exists in the system and displays information about the record in context as a medal. Salesforce administrators need to use this component within the Lightning App Builder, Which two settings should the developer configure within the xml resource file?
Choose 2 answers

  • A. Specify the target to be lightning_RecordPage
  • B. Set the IsExposed=d attribute to true.
  • C. Specify the target to be lightning_AppPage
  • D. Set the IsVisible attribute to true

Answer: A,B

Explanation:
The two settings that the developer should configure within the xml resource file are to specify the target to be lightning_RecordPage and to set the IsExposed attribute to true. The target element defines where the component can be used, and the lightning_RecordPage value indicates that the component can be used on a Lightning record page. The IsExposed attribute determines whether the component is available in tools such as App Builder or Experience Builder, and setting it to true exposes the component to these tools. The IsVisible attribute is not a valid answer, as it is not a valid attribute for the xml resource file, and it does not affect the availability of the component. The lightning_AppPage value is not a valid answer, as it indicates that the component can be used on a Lightning app page, not a Lightning record page. Reference: [Configure Components for Lightning Pages and the Lightning App Builder], [Lightning Web Components Developer Guide]


NEW QUESTION # 102
A developer is trying to decide between creating a Visualforce component or a Lightning component for a custom screen.
Which functionality consideration impacts the final decision?

  • A. Does the screen need to be rendered as a PDF without using a thirdparty application?
  • B. Does the screen need to be accessible from the Lightning Experience UI?
  • C. Will the screen be accessed via a mobile app?
  • D. Will the screen make use of a JavaScript framework?

Answer: A

Explanation:
Visualforce can render pages as PDFs, which Lightning Components cannot do. This functionality is crucial if PDF rendering is required.
References: Visualforce Developer Guide - Rendering a Page as a PDF


NEW QUESTION # 103
A developer wrote a test class that successfully asserts a trigger on Account. It fires and updates data correctly in a sandbox environment.
A salesforce admin with a custom profile attempts to deploy this trigger via a change set into the production environment, but the test class fails with an insufficient privileges error.
What should a developer do to fix the problem?

  • A. Verify that Test, statement ( ) is not inside a For loop in the test class.
  • B. Add seeAllData=true to the test class to work within the sharing model for the production environment.
  • C. Add system.runAd ( ) to the best class to execute the trigger as a user with the correct object permissions.
  • D. Configure the production environment to enable ''Run All tests as Admin User.''

Answer: C


NEW QUESTION # 104
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. List 1Accounts = (Select ID, Name, Type from Account Join (Select ID, firstname, lastname form Contact where contact account , name 'ozone electronics));
  • B. Account a = (SELECT ID, Name, Type from Account where name= Ozone Electronics;) list 1contacts = (SELECT firstname, lastname from Contacts where accountid=: a -ID0;
  • C. Account a = (SELECT ID, Name, Type, (select contat,firstName, Contact,LastName from Account, Contacts) from Account where name; Ozone Electronic' Limit 1 );
  • D. 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);)

Answer: C


NEW QUESTION # 105
......

Q&As with Explanations Verified & Correct Answers: https://buildazure.actualvce.com/Salesforce/PDII-valid-vce-dumps.html