Categories
Certification Guide

Platform Developer II Certification

In this blog, I have highlighted some topics which I found important based on my exam and you can expect one or two questions from each. These topics are perfect for revision before your PD II certification.

The topics are segregated as Visualforce, Apex, and Lightning.

About

Platform Developer II program is designed to demonstrate the skills and knowledge in advanced programmatic capabilities of the Lightning Platform and data modeling to develop complex business logic and interfaces.

To earn this credential you need to complete following two steps

  1. Advanced Apex Specialist Superbadge
  2. PDII Proctored MCQ

Strategy

You can find some tips on strategizing your certification exam from my blog about Certified System Architect.

Important Topics

Following are the topics which should be studied thoroughly and also good for a quick revision.

Visualforce

  1. Transient Keyword Developer Guide
    • Use the transient keyword to declare instance variables that can’t be saved and shouldn’t be transmitted as part of the view state for a Visualforce page.
  2. Visualforce for Large Data Volumes & Lazy Loading Developer Guide
    • Loads specific parts of the page for faster access using custom rendering, Javascript Remoting, and Custom Components.
  3. Visualforce Controllers
    1. Standard Controller – Guide
      • What all can be done directly with a standard controller and not using any custom controller or extension?
      • What are all available actions in a standard controller? Answer.
    2. Custom Controller & Controller Extension – Guide
      • When to go for a custom controller instead of using a controller extension?
    3. Standard Set Controller – Guide
      • Supports 10,000 rows of data.
**CONTROLLER EXTENSION**
public myControllerExtension(ApexPages.StandardController stdController){
this.acct = (Account)stdController.getRecord(); 
}

**SET CONTROLLER**
setCon = ApexPages.StandardSetController(Database.getQueryLocator(queryString));
setCon.setPageSize(size); --> Sets page Size
setCon.getResultSize(); -->  Find total record count
setCon.getRecords(); --> Find the records to be displayed
{!setCon.first}, {!setCon.next}, {!setCon.previous}, {!setCon.last} --> Pagination Methods
  1. Related List VF Component
    • Can be implemented using a standard controller itself.
<apex:detail relatedList =”false”/>
<apex:relatedList list=”Contacts”/>
  1. JS Remoting & VF Remote ObjectsGuide
    • JS Remoting – Guide
      • Makes basic CRUD object access easy
      • Doesn’t require any Apex code
      • Supports minimal server-side application logic
      • Doesn’t provide automatic relationship traversals; you must look up related objects yourself
    • VF Remote Object – Guide
      • Requires both JavaScript and Apex code
      • Supports complex server-side application logic
      • Handles complex object relationships better
      • Uses network connections (even) more efficiently
  2. VF Page Testing setCurrentPage()StackExchange
**Page reference is passed as a parameter**
Pagereference pref = page.AccountPage;
Test.setCurrentPage(pref);
  1. Continuation VF pageGuide
    1. Action methods return a continuation object
      1. public Object calloutActionMethodName()
    2. Callback Methods
      1. public static Object callbackMethodName(List< String> labels, Object state)
      2. Returns null, page reference, or another continuation for chaining more continuations.
    3. You can chain up to three callouts.
    4. In test classes add a mock response
      1. Test.setContinuationResponse(controller.requestLabel, response);
  2. Visualforce Pagination ( > 10,000 records ) – Developer Blog
    1. What will be the optimal approach for pagination based on data volume and customizations requirement?
  3. ActionSupport – ActionFunction – ActionRegion
    • Action Function – JS function in VF page to call controller method. (Must be inside apex:form)
    • Action Support – Add JS event or AJAX support to a component and then call the controller method.
    • Action Region – Optimize VF page performance during an AJAX request.

Apex

  1. DML and Callouts (Limits and Limitations) – Guide
    • To perform Callouts from trigger context use @future block.
    • Callouts cannot be done after DML statements, reverse is possible.
    • For testing implement Test.setMock(mock callout class) and execute in between Test.startTest() and Test.stopTest()
    • 100 callouts are allowed in a single transaction
    • 120 seconds is the maximum cumulative time allowed for callouts in a single transaction.
  2. Query optimization for LDV and Selective SOQL Query – Improve Performance – Help Article
    1. Use Skinny Table – Apex Hours Session
    2. Indexed Table – Apex Hours Session
      • Standard Index (up to 1 M, 30% of 1 M and 15% of additional each million records)
      • Custom Index (up to 333K, 10% of each 500K records)
    3. Query Plan Tool – Help Article
      • A tool within the developer console to determine the performance of your SOQL query
    4. Make SOQL Selective – Help Article
      • Indexing will not work if
        • Not Equal To, Not Contains, Not Starts with used
        • Comparing with NULLS
        • Contains operator used and number of rows scanned is > 333K
        • Exceeds any of the upper limits defined for indexing.
      • Following can’t be Indexed
        • Multi-select picklist, Currency (multi-currency org), Long text, binary fields.
        • Formula of the following type
          • Non-Deterministic – Uses NOW or TODAY and value changes based on time.
          • Lookup to multiple objects
          • Includes any non-supported index fields
          • Includes Text(picklist field)
  3. Concurrent usage (Governor limits) – Trailhead
    1. Max 25 long-running API Requests (time > 20 seconds).
    2. Callouts cause concurrency between systems
    3. Reduce the following:
      1. Number of Apex Triggers
      2. The complexity of your Query
      3. Switch to Async process
      4. Data you are processing in one transaction.
    4. Solutions
      1. Async Callouts (Continuation)
      2. Selective Query
      3. Bulkify and reduce no of Apex triggers.
  4. SOQL with Big ObjectGuide
    • The !=, LIKE, NOT IN, EXCLUDES, and INCLUDES operators are not valid in any query.
    • Aggregate functions are not valid in any query.
    • Only the last field in a query can use the following operators (=, <, >, <=, >=, and IN)
  5. SOQL FunctionsGuide
    1. Localized Results SELECT statements can include the Translating Results, ConvertCurrency(), and FORMAT() functions in support of localized fields.
    2. Use toLabel(fields) to translate SOQL query results into the user’s language.
    3. Use SCOPE clause of a SOQL query to return records within a specified scope.
      • delegated, everything, mine, mine_and_my_groups, my_territory, my_team_territory…
    4. KnowledgeArticleVersion SOQL Clause – UPDATE TRACKING, UPDATE VIEWSTAT
    5. HAVING – use a HAVING clause with a GROUP BY clause to filter the results returned by aggregate functions, such as SUM().
    6. TYPEOF – A TYPEOF expression specifies a set of fields to select that depends on the runtime type of the polymorphic reference.
    7. You can update objects with information about when they were last viewed by using the FOR VIEW clause in a SOQL query.
    8. FOR REFERENCE – The LastReferencedDate field is updated for any retrieved records.
    9. Use FOR UPDATE to lock sObject records while they’re being updated in order to prevent race conditions and other thread safety problems.
    10. Security with SECURITY_ENFORCED clause.
  6. Platform Events and Streaming APIGuide
    • Streaming API uses the Bayeux protocol and CometD, so the client-to-server connection is maintained through long polling.
    • Publishing Platform Events
      • Process Builder using the Create a Record action
      • Flow using a Create Records element
      • Apex EventBus.publish() method
      • REST API sObjects resource
      • SOAP API create() call
    • Subscribing to Platform Events
      • Process Builder using a process that starts when a platform event occurs
      • A flow that waits for a platform event to occur
      • Apex trigger
      • Streaming API using the CometD messaging library
      • The empApi Lightning component
  7. Static ResourcesHelp Article
    1. Package a collection of related files into a directory hierarchy and upload that hierarchy as a .zip or .jar archive.
    2. Reference a static resource in page markup by name using the $Resource global variable.
    3. Use relative paths in files in static resource archives to refer to other content within the archive. 
      • For example, in your CSS file, named styles.css, you have the following style:
        • table { background-image: url('img/testimage.gif') }
      • create an archive (such as a zip file) that includes styles.css and img/testimage.gif
      • <apex:stylesheet value="{!URLFOR($Resource.style_resources, 'styles.css')}"/>
    4. A single static resource can be up to 5 MB in size.
    5. An organization can have up to 250 MB of static resources.
    6. Static resources apply to your organization’s quota of data storage.
  8. Load test data from Static Resource
    • Account records and a static resource name of myResource, make the following call:
      • List<sObject> ls = Test.loadData(Account.sObjectType, 'myResource');

LWC and Aura

  1. @AuraEnabled AnnotationGuide
    • Apex class static methods to make them accessible as remote controller actions in your Lightning components.
    • Apex instance methods and properties to make them serializable when an instance of the class is returned as data from a server-side action.
    • @AuraEnabled(cacheable=true) – You can improve runtime performance by caching method results on the client by adding (cacheable=true) to the annotation [API version 44.0 and above]. setStorable() was used in JS before this feature.
    • @AuraEnabled(continuation=true) – Use the continuation class in Apex to make a long-running request to an external web service.
    • Separate by space when used together. @AuraEnabled(continuation=true cacheable=true)
  2. Component JS Debugging Guide
    1. Enable Debug Mode for Lightning Components – Framework JavaScript code isn’t minified and is easier to read and debug.
      • Performance is slowed down drastically and should be used temporarily
    2. Disable Caching Setting During Development – Session Setting
      • Enable secure and persistent browser caching to improve performance
    3. Salesforce Lightning Inspector Chrome Extension
    4. Log Messages using console.log() in browser’s dev console.
  3. <lightning:layout/> multipleRows attributes Component Library
    • multipleRows(default=false) – Determines whether to wrap the child items when they exceed the layout width. If true, the items wrap to the following line.
  4. <lightning:layoutItem/> Device Size attributesComponent Library
    1. If the viewport is divided into 12 parts, this attribute indicates the relative space.
    2. Accepts integer from 1 to 12
    3. Attributes available are:
      • largeDeviceSize – Desktop
      • mediumDeviceSize – Tablet
      • smallDeviceSize – Mobile 
  5. Salesforce Lightning Inspector (Tabs and Usage) – Guide
    • Use of Storage and Actions tabs.
  6. Events Anti-PatternsGuide
    • Don’t Fire an Event in a Renderer – Firing an event in a renderer can cause an infinite rendering loop.
  7. Error handling for LWC – Developer Blog
  8. Events in Aura Components
    1. Component Event
      • var compEvent = cmp.getEvent("sampleComponentEvent");
    2. Application Event
      • var appEvent = $A.get("e.c:appEvent");
  9. Aura component in Custom ActionsGuide
    • For your Aura component to work as a custom action, you must set a default value for each component attribute marked as required.

Conclusion

Platform Developer II is a certification focused on testing your programming skills and you should do hands on with trailmix and superbadge on Trailhead.

The topics outlined in the blog are from my preparation notes and post-mortem of the examination.

Thank you for reading through and all the best for your certification.

Please share your feedback and I’ll incorporate it in my upcoming blogs.