Free Certified Platform Developer II Exam Braindumps (page: 7)

Page 7 of 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 accountName) {
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?

  1. Account a = controller.getAccount('TestAccount');
    System.assertEquals( 'TestAccount', a.Name );
  2. MyRemoter remote = new MyRemoter();
    Account a = remote.getAccount('TestAccount');
    System.assertEquals( 'TestAccount', a.Name );
  3. MyRemoter remote = new MyRemoter('TestAccount');
    Account a = remote.getAccount ();
    System.assertEquals( 'TestAccount', a.Name );
  4. Account a = MyRemoter.getAccount('TestAccount');
    System.assertEquals( 'TestAccount', a.Name );

Answer(s): D



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?

  1. <apex:message for="info"/>
  2. <apex:facet name="messages" />
  3. <apex:pageMessage severity="info" />
  4. <apex:pageMessages />

Answer(s): D



A developer is writing code that requires making callouts to an external web service.
Which scenario necessitates that the callout be made in an @future method?

  1. The callouts will be made in an Apex Trigger.
  2. The callouts will be made in an Apex Test class.
  3. The callout could take longer than 60 seconds to complete.
  4. Over 10 callouts will be made in a single transaction.

Answer(s): A



A developer wants to call an Apex Server-side Controller from a Lightning Aura Component.
What are two limitations to the data being returned by the Controller? (Choose two.)

  1. A custom Apex Class can be returned, but only the values of public instance properties and methods annotated with @AuraEnabled are serialized and returned.
  2. Lists of Custom Apex Classes cannot be returned by Apex Controllers called by Lightning Aura Components.
  3. Basic data types are supported, but defaults, such as maximum size for a number, are defined by the objects that they map to.
  4. Only Basic data types and sObjects are supported as return types for Apex Controllers called by Lightning Aura Components.

Answer(s): A,C



Page 7 of 90



Post your Comments and Discuss Salesforce Certified Platform Developer II exam with other Community members:

Jenil Gandhi commented on November 14, 2024
Hi everyone could sone share the certification voucher for PD2.
INDIA
upvote

Aniq commented on December 02, 2023
Hi every one Could some share the certification voucher for PD2
Anonymous
upvote

Rasheed commented on June 07, 2023
Worth the price. I got 50% off when I selected 2 exams.
PAKISTAN
upvote

Lisha commented on September 21, 2022
Thank you!
Anonymous
upvote