Practice Free PDII Exam Online Questions
A developer created the code to perform an HTP GET request to an external system.
When the code is executed, the callout is unsuccessful and the following error appears within the Developer Console:System.CalloutException: Unauthorized endpoint
Which recommended approach should the developer implement to the callout exception?
- A . create a remote site setting configuration that includes the endpoint.
- B . Annotate the getERPCatalogContents method With @Future (Callout-true)
- C . use the setHeader () method to specify Basic Authentication.
- D . Change the access modifier for ERPCatelog from Public to global
Consider the following code snippet:
Which two steps should the developer take to add flexibility to change the endpolnt and credentials without needing to modify code? Choose 2 answers
- A . Create a Named Credential, endPoint_NC, to store the endpoint and credentials.
- B . Store the URL of the endpoint in a custom Label named endPointURL.
- C . Use req.setEndpoint(,callcut:endPoint_NC,); within the callout request.
- D . Use req.setEndpoint(Label.endPointURL);.
As part of a custom development, a developer creates a Lightning component to show how a particular opportunity progresses over time.
The component must display the date stamp when any of the following fields change:
• Amount, Probability, Stage, or Close Date
How should the developer access the data that must be displayed?
- A . Execute a SOQL query for Amount, Probability, Stage, and Close Date on the OpportunityHistory object.
- B . Create custom a custom date field on Opportunity for each field to track the previous date and execute a SOQL query for date fields.
- C . Subscribe to the Opportunity Change Data Capture event in the Lightning component.
- D . Subscribe to the OpportunityHistory Change Data Capture event in the Lightning component.
Universal Containers decided to use Salesforce to manage a new hire interview process. A custom object called candidate as created with organization-wide default set to Private. A lookup on the Candidate object sets an employee as an the viewer user
- A . The record can be shared using a permission set.
- B . The record can be shared using a sharing rule.
- C . The record cannot be shared with the current setup
- D . The record can be shared an Apex class.
Users report that a button on a custom Lightning Web Component is not working. However, there are no other details provided.
What should the developer use to ensure error messages are properly displayed?
- A . Add the <apex:messages/> tag to the component.
- B . Use the Database method with allOrNone set to false.
- C . Add a Try/Catch block surrounding the DML statement.
- D . Add JavaScript and HTML to display an error message.
AWC wants the real-time inventory reduction for a product to be sent to many of its external systems, including some future systems the company is Currently planning.
What should a develops add to the code at the placeholder to meet these requirement!?
A)
B)
C)
D)
- A . Option A
- B . Option B
- C . Option C
- D . Option D
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 . Use a Map accountMap instead of List accountList.
- B . Use a Map to cache the results of the Region__c query by Id.
- C . Move the Region__c query to outside the loop.
- D . Remove the last line updating accountList as it is not needed.
Which use case can be performed only by using asynchronous Apex?
- A . Making a call to schedule a batch process to complete in the future
- B . Calling a web service from an Apex trigger
- C . Querying tens of thousands of records
- D . Updating a record after the completion of an insert
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 . MyRemoter remote = new MyRemoter(); Account a = remote.getAccount ({‘TestAccount’); System.assertEquals, ‘TestAcccunt’, a.Name -;
- B . Account a = MyRemoter.getAccount (‘TestAccount’): System.assertEquals{ ‘TestAccount’, a.Name };
- C . MyRemoter remote = new MyRemoter(‘TestAccount’};
Account a = remote.getAccount {);System.assertEquals(, ‘’TestAccount’, a.Name -; - D . Account a = controller.getAccount(‘TestAccount’); System.assertEquals(, ‘TestAccount’, a.Name } ;
A developer creates an application event that has triggered an infinite loop.
What may have caused this problem?
- A . The event is fired from a custom renderer.
- B . An event is fired ‘ontouchend’ and is unhandled.
- C . The event has multiple registered in the project.
- D . The event handler calls a trigger.