trailhead

Maintain Your Platform Developer I Certification for Summer ’18

Learning Objectives

After completing this unit, you'll be able to:

  • Discuss the top new features for platform developers.
  • Maintain your Salesforce Certified Platform Developer I certification.

Salesforce Certification—The Big Picture

Hey Trailblazer, if you hold the Salesforce Certified Platform Developer I credential, keep in mind that you need to complete this module by December 14, 2018, to maintain your certification. Check out the deadlines here

You also need to link your Trailhead and Webassessor accounts by December 14, 2018, so we know you've maintained your credential(s).

If you've already linked your accounts, you're all set. If you're not sure, follow these steps to check your account status and link your accounts.

  1. Go to http://sfdc.co/mystatus.
  2. In the Webassessor Email field, enter your Webassessor email address and click Request.
  3. Check your inbox and follow the steps to link.

Interested in learning more about getting certified? Check out the Salesforce Certified Platform Developer I credential.

Style Existing Visualforce Pages with Lightning Experience Stylesheets

You can control whether a page is styled with the look of Lightning Experience when viewed in Lightning Experience or the Salesforce app with the lightningStylesheets attribute.

To style your Visualforce page to match the Lightning Experience UI when viewed in Lightning Experience or the Salesforce app, set lightningStylesheets="true" in the <apex:page> tag. When the page is viewed in Salesforce Classic, it doesn’t get Lightning Experience styling.  

Here is a standard Visualforce page without the lightningStylesheets attribute. The page is styled with the Classic UI. A Visualforce page styled with the Classic UI.

Here is the same Visualforce page with the lightningStylesheets attribute set to true. The same Visualforce page with the Lightning look and feel.

You can style most commonly used Visualforce components with the lightningStylesheets attribute. However, some components differ slightly in style from Lightning Experience. For example, <apex:selectOptions>, <apex:selectRadio>, <apex:inputFile>, and some <apex:inputField> elements use the browser’s default styling instead. Commonly used Visualforce components that don’t require styling, such as <apex:form>, <apex:outputText>, and <apex:param>, are still supported.

To include SLDS components that aren’t part of the Visualforce component library, you can use the <apex:slds /> tag with custom SLDS code in addition to the lightningStylesheets attribute. The lightningStylesheets attribute doesn’t affect custom styling, so custom code must be updated to match the page’s SLDS styling.

The list of Visualforce components detailed here support the lightningStylesheets attribute or don’t require styling.

Quickly Identify the Salesforce Theme That Users See in JavaScript

If you use a lot of JavaScript in your pages and apps, identifying the Salesforce user experience helps you manage navigation in your JavaScript code. Detecting the Salesforce theme used to require multiple steps and utility functions. The streamlined process involves one new function: UITheme.getUITheme(). UITheme.getUITheme() returns a string that indicates the current user’s interface theme.

Example:

  function isLightningDesktop() {
    return UITheme.getUITheme === "Theme4d";
      }

Use these variables to identify the CSS used to render Salesforce web pages to a user. 

  • Theme1—Obsolete Salesforce theme
  • Theme2—Salesforce Classic 2005 user interface theme
  • Theme3—Salesforce Classic 2010 user interface theme
  • Theme4d—Modern Lightning Experience Salesforce theme
  • Theme4t—Salesforce mobile app theme
  • Theme4u—Lightning Console theme
  • PortalDefault—Salesforce Customer Portal theme
  • Webstore—Salesforce AppExchange theme

To learn more about rendering different layouts based on a user’s theme click here.

New Apex Classes

TestBroker Class in the EventBus Namespace

The new EventBus.TestBroker class contains a method that delivers platform event messages in an Apex test.

deliver()

Delivers platform event messages to the test event bus. Use this method to deliver test event messages multiple times and verify that event subscribers have processed the test events each step of the way.

UserManagement Class in the System Namespace

The new System.UserManagement class contains methods to manage end users, for example, to register verification methods or handle requests for Salesforce to forget them.

deregisterVerificationMethod(userId, method)

Deregisters an identity verification method. Use this method to allow users to delete an existing verification method.

formatPhoneNumber(countryCode, phoneNumber)

Formats a mobile phone number for a user. Call this method to ensure that the phone number is formatted properly before updating a user’s mobile phone number.

obfuscateUser(userId, username)

Scrambles users’ data on their request when they no longer want their personal data recognized in Salesforce. When you invoke the method for the user, the data becomes anonymous, and you can never recover it. Use the username method to set the username to a specific value after it’s scrambled.

registerVerificationMethod(method, startUrl)

Registers an identity verification method. Verification methods include a time-based one-time password, email or text one-time password, Salesforce Authenticator, or Universal Second Factor (U2F). End users register their verification methods.

Get the Developer Name for Record Types More Easily

New Apex methods help you get the developer name for record types more easily. Previously, the developer name was accessible only via SOQL on the RecordType SObject, and not via describe information. Now you can use the following methods to get the developer name.

  • Schema.DescribeSObjectResult.getRecordTypeInfosByDeveloperName()
  • Schema.RecordTypeInfo.getDeveloperName()

Understand How to Troubleshoot Processes and Flows

Flows can do lots of powerful things, and those things often count toward your per-transaction limits. Now you can use debug logs to identify which flow elements contribute the most against those limits. These details help you troubleshoot errors and monitor usage as you activate and distribute your flows. You can also use these details while testing flows that you’re building to prevent them from reaching governor limits at run time.

Access debug logs from the Logs tab in the Developer Console. Or from Setup, enter Debug Logs in the Quick Find box. In the level, set Workflow to Finer.

Use these debug event types to monitor flow usage against per-transaction governor limits.

  • FLOW_START_INTERVIEW_LIMIT_USAGE—Includes the number used by the transaction upon starting the flow interview but before executing flow elements. Also includes the per-transaction limit.
  • FLOW_ELEMENT_LIMIT_USAGE—Includes the number used by the flow element, the total count used by the transaction after executing the element, and the per-transaction limit.
  • FLOW_BULK_ELEMENT_LIMIT_USAGE—Includes the number used by the element executed in bulk, the total count used by the transaction after executing the element, and the per-transaction limit.

Example:

...
... |FLOW_START_INTERVIEW_LIMIT_USAGE|SOQL queries: 1 out of 100
... |FLOW_START_INTERVIEW_LIMIT_USAGE|SOQL query rows: 100 out of 50000
... |FLOW_START_INTERVIEW_LIMIT_USAGE|SOSL queries: 0 out of 20
... |FLOW_START_INTERVIEW_LIMIT_USAGE|DML statements: 1 out of 150
... |FLOW_START_INTERVIEW_LIMIT_USAGE|DML rows: 10 out of 10000
... |FLOW_START_INTERVIEW_LIMIT_USAGE|CPU time in ms: 0 out of 15000
... |FLOW_START_INTERVIEW_LIMIT_USAGE|Heap size in bytes: 0 out of 6000000
... |FLOW_START_INTERVIEW_LIMIT_USAGE|Callouts: 0 out of 100
... |FLOW_START_INTERVIEW_LIMIT_USAGE|Email invocations: 0 out of 10
... |FLOW_START_INTERVIEW_LIMIT_USAGE|Future calls: 0 out of 50
... |FLOW_START_INTERVIEW_LIMIT_USAGE|Jobs in queue: 0 out of 50
... |FLOW_START_INTERVIEW_LIMIT_USAGE|Push notifications: 0 out of 10
...
... |FLOW_ELEMENT_LIMIT_USAGE|1 DML statements, total 2 out of 150
... |FLOW_ELEMENT_LIMIT_USAGE|1 DML rows, total 11 out of 10000

Update Multiple Validation Rules with Custom Metadata Type Records

With custom metadata type records available to reference in validation rules, you don't need to hard code values. Reference the records directly within the validation rules to avoid adding the same values to each rule. The ability to reference custom metadata type records helps subscriber orgs, too. Previously, when you added a validation rule to a managed package, a subscriber could not edit it. Now you can define the logic and leave customization to a subscriber.

Consider a validation rule that limits the discount on a brand to 10%. You decide to change the discount, so the validation rules that use this value need updating. Rather than update multiple rules that check the discount amount, reference a custom metadata record within the validation rules. Then, you can update the discount amount in the custom metadata record without modifying the validation rule.

The Discount Limits field is set to use the maximum discount of 10%.

The Discount Limits field can have its maximum discount changed through a user interface.

New URL Format for Lightning Experience and the Salesforce Mobile App

It’s official! There’s a new URL format in town. When setting up pointers to areas in your Salesforce org, you can now take advantage of our shorter, easier-to-understand URLs.

The new URL format is more readable, addressing the issue of being directed to an unexpected location when accessing Lightning Experience URLs before authenticating.

Here are some examples of the new format.

  • Object Home page:
    • Previous format: https://<lightning.domain.com>/one/one.app/#/sObject/Account/home
    • New format: https://<lightning.domain.com>/lightning/o/Account/home
  • Record page:
    • Previous format: https://<lightning.domain.com>/one/one.app#/sObject/006R000000245p1IAA/view
    • New format: https://<lightning.domain.com>/lightning/r/Opportunity/006R000000245p1IAA/view

See how /lightning has replaced /one/one.app? Existing URLs that use /one/one.app, like ones you’ve saved or have in emails, will continue to work. When they’re executed, they’re translated into the new format. In console apps, you can even use the new URL format to share your workspace and active subtab by simply copying the URL directly from your browser’s address bar. You can also use the new URLs with the Lightning Console JavaScript API. Nifty!

Custom or installed Lightning components that parse a URL may break or behave differently after this change, especially components with logic that relies on window.location or the aura:locationChange event.

If you have query string parameters appended to /one/one.app such as /one/one.app?myparam1=xyz&amp;myparam2=abc, they’re rewritten as /lightning?0.myparam1=xyz&amp;0.myparam2=abc.

retargeting