[2025年更新]合格できるSalesforce PDII試験最新198問題 [Q64-Q86]

Share

[2025年更新]合格できるSalesforce PDII試験最新198問題

ゲット2025年最新の無料Salesforce PDII試験問題 アンサー


Salesforce PDII(Salesforce Certified Platform Developer II)認定試験は、Salesforce開発の分野で非常に尊敬される認定です。この認定は、Salesforce Developmentの高度なスキルを持ち、キャリアの見通しを強化しようとしている開発者向けに設計されています。 PDII認定試験は、Apexプログラミング、稲妻コンポーネント、アプリケーション設計など、高度なSalesforce開発の概念に関する候補者の知識をテストすることを目的としています。

 

質問 # 64
A custom Visualforce controller calls the ApexPages.addMessage() method, but no messages are rendering on the page.
Which component should be added to the Visualforce page to display the message?

  • A. <apex:pageMessages />
  • B. <apex:facet name="messages" />
  • C. <apex:pageMessage severity="info" />
  • D. <apex:message for="info"/>

正解:A


質問 # 65
Which use case can be performed only by using asynchronous Apex?

  • A. Updating a record after the completion of an insert
  • B. Calling a web service from an Apex trigger
  • C. Making a call to schedule a batch process to complete in the future
  • D. Querying tens of thousands of records

正解:B


質問 # 66
Consider the following code snippet:

Users of this Visualforce page complain that the page does a full refresh every time the Search button is pressed.
What should the developer do to ensure that a partial refresh is made so that only the section identified with opportunity List Is re-drawn on the screen?

  • A. Implement the reRender attribute on the <apex:commandButton>tag.
  • B. Ensure the action method search returns null.
  • C. Enclose the DATA table within the <apex:actionRegion> tag.
  • D. Implement the <apex:actionFunction> tag with immedate _true.

正解:A


質問 # 67
A developer is creating unit tests for code that makes SOAP web service callouts. The developer needs to insert some test data as a part of the unit tests setup. What are three actions to enable this functionality?

  • A. Surround the data insertion with Test.startTest(), Test.stopTest().
  • B. Implement the HttpCalloutMock interface.
  • C. Implement the WebServiceMock interface.
  • D. Surround the callout with Test.startTest(), Test.stopTest().
  • E. Update code to call Test.setMock().

正解:C、E


質問 # 68
Which interface needs to be implemented by a Lightning Component so that it may be displayed in modal dialog by clicking a button on a Lightning Record page?

  • A. Lightning:editAction
  • B. Force: lightningQuickAction
  • C. Fightning:quickAction
  • D. Force:lightningEditAction

正解:C


質問 # 69
Which tag should a developer use to display different text while an <apex:commandButton> is executing versus not executing?

  • A. <ApexpageMessages>
  • B. <ApexactionSupper>
  • C. <apexactionPoller>
  • D. <ApexactionStatus>

正解:D


質問 # 70
Exhibit.

A developer created a JavaScript function as a part of a Lightning web component (LWC) that surfaces information... about leads by imperatively calling getFetchLeadList when certain criteria are met.
What are these changes the developer should implement in the Apex class above to ensure the LWC can displ... data efficiently while preserving security?
Choose 3 answers

  • A. Annotate the Apex method with gAuraEnabled-
  • B. Implement the without sharing keyword in the class declaration.
  • C. Annotate the Apex method with 8AuraEnabled (Cacheable-true).
  • D. Implement the with sharing keyword in the class declaration.
  • E. Use the WITH SECURITY_ENFORCED clause within the SOQL query.

正解:C、D、E


質問 # 71
Refer to the exhibit

Users of this Visualforce page complain that the page does a full refresh every time the Search button Is pressed.
What should the developer do to ensure that a partial refresh Is made so that only the section identified with opportunity List is re-drawn on the screen?

  • A. Implement the render attribute on the <apex:ccxmandButton> tag.
  • B. Ensure the action method search returns null.
  • C. Enclose the DATA table within the <apex:actionRegion> tag.
  • D. Implement the <apex:actionfunction> tag with immediate = true.

正解:A

解説:
The developer should implement the render attribute on the apex:commandButton tag to ensure that a partial refresh is made so that only the section identified with opportunity List is re-drawn on the screen. The render attribute specifies the ID of one or more components that are redrawn when the result of an AJAX update request returns to the client. The developer can use the render attribute to limit the scope of the refresh to the apex:pageBlock component that contains the data table, and avoid refreshing the entire page. Enclosing the data table within the apex:actionRegion tag will not help, as the apex:actionRegion tag defines a section of a page that demarcates a form within a form, and allows the developer to limit the processing of form elements to the contents of the region. However, it does not affect the refresh of the page or the components. Ensuring the action method search returns null will not help, as it will only prevent the page from reloading, but it will not refresh the data table with the new search results. Implementing the apex:actionFunction tag with immediate = true will not help, as the apex:actionFunction tag defines a JavaScript function that can invoke a controller action method, and the immediate attribute specifies whether the action method is executed immediately, without processing any validation rules. However, it does not affect the refresh of the page or the components. Reference: [apex:commandButton], [apex:actionRegion], [apex:actionFunction], [Visualforce Developer Guide]


質問 # 72
A developer is using a third-party JavaScript library to create a custom user interface in Visualforce. The developer needs to use JavaScript to get data from a controller method in response to a user action. How can the developer accomplish this?

  • A. Use the @RemoteAction annotation on the method definition with JavaScript Remoting.
  • B. Use to create a JavaScript wrapper for the controller method.
  • C. Use the $Controller global variable to access the controller method via JavaScript.
  • D. Use to enable JavaScript support for the controller method.

正解:A


質問 # 73
A developer recently released functionality to production that performs complex commission calculations in Apex code called from an Opportunity trigger. Users report that the calculations seem incorrect because the values they see for commissions are wrong.
The developer has representative test data in their developer sandbox.
Which three tools or techniques should the developer use to execute the code and pause it at key lines to visually inspect values of various Apex variables?
Choose 3 answers

  • A. Breakpoints
  • B. Apex Replay Debugger
  • C. visual Studio Code
  • D. Workbench
  • E. Developer Console

正解:B、C、E


質問 # 74
What is a potential design issue with the following code?
trigger accountTrigger on Account (before update){ Boolean processOpportunity
= false; List<opportunity> opptysClosedLost = new List<opportunity>()
List<opportunity> IstAllOpp = [select StageName from Opportunity where
accountId IN :Trigger.newMap.keySet()]; if(!IstAllOpp.isEmpty())
processOpportunity = true; while(processOpportunity){ for(opportunity o :
IstAllOpp) if(o.StageName == 'Closed - Lost') opptysClosedLost.add(o);
processOpportunity = false; if(!opptysClosedLost.isEmpty()) delete
opptysClosedLost;

  • A. The code will result in a System.LimitException : Too many script statements error
  • B. The code will result in a System.LimitException: Apex CPU time limit exceeded error
  • C. The code will result in a System.DmlException:Entity_is_Deleted error
  • D. SOQL could be avoided by creating a formula field for StageName in Account from the related Opportunity

正解:B


質問 # 75
A business requires that every parent record must have a child record. A developer writes an Apex method with two DML statements to insert a parent record and a child record.
A validation rule blocks child records from being created. The method uses a try/catch block to handle the DML exception.
What should the developer do to ensure the parent always has a child record?

  • A. Use Catabase.inserc() and set the all = parameter to true,
  • B. Set a database savepoint to rollback if there are errors.
  • C. Delete the parent record in the catch statement when an error occurs on the child record DML operation.
  • D. Use addExror() on the parent record if an error occurs on the child record.

正解:C

解説:
To ensure the parent always has a child record, the developer should use Database.insert and set the allOrNone parameter to false. The Database.insert method is a variant of the insert DML statement that allows the developer to specify whether to roll back the entire transaction or allow partial success when an error occurs. The allOrNone parameter is a Boolean value that determines this behavior. If the allOrNone parameter is set to true, the entire transaction is rolled back if any record causes an error, which is the same as the insert statement. If the allOrNone parameter is set to false, the records that do not cause errors are inserted, and the ones that do cause errors are returned in a Database.SaveResult array. The developer can then handle the errors accordingly. In this scenario, the developer should use Database.insert and set the allOrNone parameter to false, so that the parent record can be inserted even if the child record fails the validation rule. The developer can then catch the DML exception and display an appropriate error message to the user. Deleting the parent record in the catch statement when an error occurs on the child record DML operation would not ensure the parent always has a child record, as it would remove the parent record as well. Setting a database savepoint to rollback if there are errors would not ensure the parent always has a child record, as it would undo the entire transaction if the child record fails the validation rule. Using addError on the parent record if an error occurs on the child record would not ensure the parent always has a child record, as it would prevent the parent record from being inserted as well. Reference: [Database Class], [Using Database Methods to Handle DML Operations]


質問 # 76
Which interface needs to be implemented by a Lightning Component so that it may be displayed in modal dialog by clicking a button on a Lightning Record page?

  • A. Force: lightningQuickAction
  • B. Lightning:editAction
  • C. Fightning:quickAction
  • D. Force:lightningEditAction

正解:A


質問 # 77
What is the transaction limit for the number of records using QueryLocator?

  • A. 100,000
  • B. There is no limit
  • C. 50,000
  • D. 50,000,000
  • E. 5,000,000

正解:D

解説:
"Scope" parameter in "executeBatch" can be set up to 2,000 records


質問 # 78
The Salesforce admin at 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.
A)

B)


D)

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

正解:C


質問 # 79
What are three benefits of using declarative customizations over code? Choose 3 answers

  • A. Declarative customizations generally require less maintenance.
  • B. Declarative customizations cannot generate run time errors.
  • C. Declarative customizations are not subject to governor limits.
  • D. Declarative customizations will automatically update with each Salesforce release.
  • E. Declarative customizations do not require user testing.

正解:A、C、D


質問 # 80
A company has a custom object, Sales Demo Request, that has a lookup to an Opportunity. It is required that a Sales Demo Request record be created when an Opportunity's Probability is greater than 50%. What is the optimal way to automate this?

  • A. Use an Apex Trigger on Opportunity.
  • B. Build a Flow on Opportunity.
  • C. Build a Process on Opportunity
  • D. Create a Workflow on Opportunity.

正解:A


質問 # 81
Which use case can be performed only by using asynchronous Apex?

  • A. Updating a record after the completion of an insert
  • B. Calling a web service from an Apex trigger
  • C. Making a call to schedule a batch process to complete in the future
  • D. Querying tens of thousands of records

正解:B

解説:
Making a callout from an Apex trigger is not allowed synchronously; hence, such callouts must be performed in an asynchronous context. The only way to perform this within the Salesforce platform is by using asynchronous Apex, such as @future methods or Queueable Apex.References: Apex Developer Guide - Asynchronous Apex


質問 # 82
What are two benefits of using External IDs? Choose 2 answers

  • A. An External ID field can be used to reference a unique ID from another, external system.
  • B. An External ID is indexed and can improve the performance of SOQL queries.
  • C. An External ID can be used with Salesforce Mobile to make external data visible.
  • D. An External ID can be a formula field to help create a unique key from two fields in Salesforce.

正解:A、B


質問 # 83
A company notices that their unit tests in a test class with many methods to create many records for prerequisite reference data are slow.
What can a developer to do address the issue?

  • A. Move the prerequisite reference data setup to a TestDataFactory and call that from each test method,
  • B. Move the prerequisite reference data setup to the constructor for the test class.
  • C. Turn off triggers, flows, and validations when running tests.
  • D. Move the prerequisite reference data setup to a @testSetup method in the test class.

正解:D

解説:
To address the issue of slow unit tests in a test class with many methods that create many records for prerequisite reference data, a developer should move the prerequisite reference data setup to a @testSetup method in the test class. A @testSetup method is a special method that runs once before all test methods in a test class and creates common test data for all test methods. This can improve the performance of the test class by reducing the number of DML operations and avoiding code repetition. The test methods can access the test data created by the @testSetup method by using SOQL queries or the Test.loadData() method. Reference: [@testSetup Annotation], [Create Test Data for Apex Tests], [Test.loadData Method]


質問 # 84
A customer has a single Visualforce page that allows each user to input up to 1500 sales forecasts and instantly view pivoted forecast calculations. Users are complaining that the page is loading slowly, and they are seeing error messages regarding heap and view state limits. What are three recommendations to optimize page performance?

  • A. Use JavaScript Remoting instead of controller actions.
  • B. Implement pagination and reduce records per page.
  • C. Create formula fields to compute pivoted forecast calculations.
  • D. Segregate calculation functionality from input functionality.
  • E. Specify the list of sales forecasts as transient.

正解:A、B、C


質問 # 85
What is the transaction limit for the number of records for SOSL?

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

正解:C

解説:
Explanation


質問 # 86
......

高合格率PDIIテスト問題集解答と正解198問題と回答:https://www.passtest.jp/Salesforce/PDII-shiken.html

PDII問題集PDFとテストエンジン試験問題:https://drive.google.com/open?id=1Mesb88--gPoCJvDHSWaHx2BQvTtqhuJs