Platform-Developer-II Exam - Platform Developer II

certleader.com

Exam Code: Platform-Developer-II (Practice Exam Latest Test Questions VCE PDF)
Exam Name: Platform Developer II
Certification Provider: Salesforce
Free Today! Guaranteed Training- Pass Platform-Developer-II Exam.

Check Platform-Developer-II free dumps before getting the full version:

NEW QUESTION 1

@isTest static void testAccountUpdate() { Account acct = new Account({Name = 'Test'); acct.Integration Updated_c = false; insert acct; CalloutUtil.sendAccountUpdate (acct.Id); Account acctAfter = [SELECT Id, Integration Updated_c FROM Account WHERE Id = :acct.Id] [0]; System.assert(true, acctAfter.Integration_Updated_c); } The test method above calls a web service that updates an external system with Account information and sets the Account's 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." What is the optimal way to fix this?

  • A. Add if (!Test.isRunningTest()) around CalloutUtil.sendAccountUpdate.
  • B. Add Test.startTest() before and Test.stopTest() after CalloutUtil.sendAccountUpdate.
  • C. Add Test.startTest() before and Test.setMock and Test.stopTest() after CalloutUtil.sendAccountUpdate.
  • D. Add Test.startTest() and Test.setMock before and Test.stopTest() after CalloutUtil.sendAccountUpdate.

Answer: B

NEW QUESTION 2

How would you test a web service?

  • A. Use the @future annotation on the method
  • B. Call the WebService interface
  • C. Web Services do not need to be tested
  • D. Create a class that implements the WebServiceMock interface

Answer: D

NEW QUESTION 3

There is an Apex controller and a Visualforce page in an org that displays records with a custom filter consisting of a combination of picklist values selected by the user.
The page takes too long to display results for some of the input combinations, while for other input choices it throws the exception, *Maximum view state size limit exceeded.
What step should the developer take to resolve this issue?

  • A. Split the layout to filter records in one Visualforce page and display the list of records in a second page using the same Apex Controller.
  • B. Adjust any code that filters by picklist values since they are not indexed.
  • C. Use a StandardSetController or SOQL LIMIT in the Apex controller to limit the number of records displayed at a time.
  • D. Remove instances of the transient keyword from the Apex controller to avoid the view state error.

Answer: C

NEW QUESTION 4

What is the optimal technique a developer should use to programmatically retrieve Global Picklist options in a Test Method?

  • A. Perform a callout to the Metadata API.
  • B. Use the Schema namespace.
  • C. Perform a SOQL Query.
  • D. Use a static resource.

Answer: B

NEW QUESTION 5

Which of the following about Dynamic Apex is incorrect?

  • A. You can retrieve the sObject type from an Id by calling .getSObjectTypeQ
  • B. getDescribe() can get you a variety of info on a particular object/field
  • C. Schema.getGlobalDescribeQ gives you a map of all sObject
  • D. In dynamic SOQL, you can use bind variables and bind variable fields

Answer: D

Explanation:
While you can use simple bind variables in dynamic SOQL, you cann|ot use bind variable fields
:myVariable.field1_c)
Use escapeSingleQuotes to prevent SOQL injection

NEW QUESTION 6

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. Build a Flow on Opportunity.
  • B. Create a Workflow on Opportunity.
  • C. Use an Apex Trigger on Opportunity.
  • D. Build a Process on Opportunity

Answer: C

NEW QUESTION 7

Which two queries are selective SOQL queries and can be used for a large data set of 200,000 Account records? Choose 2 answers

  • A. SELECT id FROM ACCOUNT WHERE Name = !: ' '
  • B. SELECT id FROM ACCOUNT WHERE Name = Null
  • C. SELECT id FROM ACCOUNT WHERE Name = Null AND Customer_Number_c= 'ValueA'
  • D. SELECT id FROM ACCOUNT WHERE id IN (list of Account Ids)

Answer: CD

NEW QUESTION 8

A developer is creating a Lightning web component that displays a list of records in a lightning-datatable. After saving a new record to the database, the list is not updating.
Platform-Developer-II dumps exhibit
What should the developer change in the code above for this to happen?

  • A. Add the @track decorator to the data variable.
  • B. Create a new variable to store the result and annotate it with @tracx.
  • C. Call refereshApex () on this.data
  • D. Create a variable to store the result and call refreshApex ().

Answer: D

NEW QUESTION 9

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 accountlnstance: Trigger.New){ if (Trigger . isBefore){ accountlnstance Exec_Count_c += 1; } System, debug (accountlnstance.Exec_Count_c); } }

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

Answer: C

NEW QUESTION 10

The test method above calls an @future method that increments the Number_of_Times_Viewed___c value. The assertion is failing because the Number_of_Times_Viewed___c equals 0. What is the optimal way to fix this?

  • A. Change the initialization to acct.Number_Of_Times_Viewed___c = 1.
  • B. Change the assertion to System.assertEquals(0, acctAfter.Number_Of_Times_Viewed___c).
  • C. Add Test.startTest() before and Test.stopTest() after AuditUtil.incrementViewed.
  • D. Add Test.startTest() before and Test.stopTest() after insert acct

Answer: A

NEW QUESTION 11

Which statement is true regarding savepoints?

  • A. Savepoints are not limited by DML statement governor limits
  • B. You can roll back to any savepoint variable created In any order
  • C. Static variables are not reverted during a rollback.
  • D. Reference to savepoints can cross trigger invocations.

Answer: C

NEW QUESTION 12

What is the optimal syntax for adding a link to a case in a Visualforce page? (Choose two.)

  • A. <apex:outputLink value="{$URLFOR($Action.Case.Open, case)}" target="blank"> {lease.Name}</apex:outputLink>
  • B. <apex:outputLink value="/{!case.Id}" target="blank"> {lease.Name}</ apex:outputLink>
  • C. <apex:outputLink value="{!URLFOR($Action.Case.View,case.Id)}" target="blank">(LIE{!case.Name}</apex:outputLink>
  • D. <apex:outputLink value="!viewCase(case.Id)}" target="_blank">{lease.Name} </apex:outputLink>

Answer: BC

NEW QUESTION 13

What should a developer use to query all Account fields for the Acme account in their sandbox?

  • A. SELECT * FROM ACCOUNT WHERE Name = ‘Acme’ LIMIT 1
  • B. SELECT ALL FROM Account WHERE Name = ‘Acme’ LIMIT 1
  • C. SELECT FIELDS FROM Account WHERE Name = ‘Acme’ LIMIT 1
  • D. SELECT FIELDS (ALL) FROM Account WHERE Name = ‘Acme’ LIMIT 1

Answer: D

NEW QUESTION 14

Given a list of Opportunity records named opportunityList, which code snippet is best for querying all Contacts of the Opportunity's Account?
A)
Platform-Developer-II dumps exhibit
B)
Platform-Developer-II dumps exhibit
C)
Platform-Developer-II dumps exhibit
D)
Platform-Developer-II dumps exhibit

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

Answer: A

NEW QUESTION 15

A company has a Request__c object that has a lookup to the Opportunity object and a custom field. Status__c, with values of Open,' Closed, and Invalid.' An Opportunity should not be allowed to be deleted if there are any Request__c records related to it that have a Status__c value of Open or 'Closed.'
what is the optimal way to enforce the requirement to prevent deletion?

  • A. A Process on Request__c
  • B. A Process on Opportunity
  • C. An Apex Trigger on Opportunity
  • D. An Apex Trigger on Request__c

Answer: C

NEW QUESTION 16

What is the transaction limit for the number of records using QueryLocator?

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

Answer: B

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

NEW QUESTION 17

A managed package uses a list of country ISO codes and country names as references data in many different places.. managed package Apex code.
What is the optimal way to store and retrieve the list?

  • A. Store the information in Custom Metadata and query it with SOQL.
  • B. Store the information in Custom Metadata and access it with the getAll() method.
  • C. Store the information in a List Custom Setting and query it with SOQL.
  • D. Store the information in a list Custom Setting and access it with the getAll() method

Answer: C

NEW QUESTION 18

An environment has two Apex Triggers: an after-update trigger on Account and an after-update trigger on Contact. The Account after-update trigger fires whenever an Account's address is updated, and it updates every associated Contact with that address. The Contact after-update trigger fires on every edit, and it updates every Campaign Member record related to the Contact with the Contact's state.
Consider the following: A mass update of 200 Account records' addresses, where each Account has 50 Contacts. Each Contact has 1 Campaign Member. This means there are 10,000 Contact records across the Accounts and 10,000 Campaign Member records across the contacts.
What will happen when the mass update occurs?

  • A. The mass update will fail, since the two triggers fire in the same context, thus exceeding the number of records processed by DML statements.
  • B. There will be no error, since each trigger fires within its own context and each trigger does not exceed the limit of the number of records processed by DML| statements.
  • C. There will be no error, since the limit on the number of records processed by DML statements is 50,000.
  • D. The mass update of Account address will succeed, but the Contact address updates will fail due to exceeding number of records processed by DML statements.

Answer: B

NEW QUESTION 19

A company exposes a REST web service and wants to establish two-way SSL between Salesforce and the REST web service. A certificate signed by an appropriate certificate authority has been provided to the developer.
What modification is necessary on the Salesforce side? (Choose two.)

  • A. Create an entry for the certificate in Certificate and Key Management
  • B. Update the code to use HttpRequest.setClientCertificateName()
  • C. Configure two-factor authentication with the provided certificate
  • D. Update the code to use HttpRequest.setHeaderQ to set an Authorization header.

Answer: AB

NEW QUESTION 20

Assuming the CreateOneAccount class creates one account and implements the Queuetable interface, which syntax tests the Apex code?
A)
Platform-Developer-II dumps exhibit
B)
Platform-Developer-II dumps exhibit
C)
Platform-Developer-II dumps exhibit
D)
Platform-Developer-II dumps exhibit

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

Answer: B

NEW QUESTION 21
......

P.S. Easily pass Platform-Developer-II Exam with 196 Q&As Dumps-hub.com Dumps & pdf Version, Welcome to Download the Newest Dumps-hub.com Platform-Developer-II Dumps: https://www.dumps-hub.com/Platform-Developer-II-dumps.html (196 New Questions)