PDII Exam Question 51

In an organization that has multi-currency enabled, a developer is tasked with building a Lighting component that displays the top ten Opportunities most recently accessed by the logged in user. The developer must ensure the Amount and LastModifiedDate field values are displayed according to the user's locale. What is the most effective approach to ensure values displayed respect the user's locale settings?1819
  • PDII Exam Question 52

    Java
    @isTest
    static void testUpdateSuccess() {
    Account acet = new Account(Name = 'test');
    insert acet;
    // Add code here
    extension.inputValue = 'test';
    PageReference pageRef = extension.update();
    System.assertNotEquals(null, pageRef);
    }
    What should be added to the setup, in the location indicated, for the unit test above to create the controller extension for the test?
  • PDII Exam Question 53

    As part of a custom interface, a developer team creates various new Lightning web components. Each of the components handles errors using toast messages. During acceptance testing, users complain about the long chain of toast messages that display when errors occur loading the components. Which two techniques should the developer implement to improve the user experience?
  • PDII Exam Question 54

    Consider the following code snippet:
    Java
    HttpRequest req = new HttpRequest();
    req.setEndpoint('https://TestEndpoint.example.com/some_path');
    req.setMethod('GET');
    Blob headerValue = Blob.valueOf('myUserName' + ':' + 'strongPassword'); String authorizationHeader = 'BASIC ' + EncodingUtil.base64Encode(headerValue); req.setHeader('Authorization', authorizationHeader); Http http = new Http(); HTTPResponse res = http.send(req); Which two steps should the developer take to add flexibility to change the endpoint and credentials without needing to modify code?1
  • PDII Exam Question 55

    An Apex trigger and Apex class increment a counter, `Edit_Count__c`, any time the Case is changed.
    ```java
    public class CaseTriggerHandler {
    public static void handle(List<Case> cases) {
    for (Case c : cases) {
    c.Edit_Count__c = c.Edit_Count__c + 1;
    }
    }
    }
    trigger on Case(before update) {
    CaseTriggerHandler.handle(Trigger.new);
    }
    ```
    A new before-save record-triggered flow on the Case object was just created in production for when a Case is created or updated. Since the process was added, there are reports that `Edit_Count__c` is being incremented more than once for Case edits. Which Apex code fixes this problem?