↑ ↓ to move, Enter to open, Esc to close

    SF-PDIPlatform Developer Ii

    Switch exam

    Microsoft Azure

    aws Amazon Web Services

    Google Cloud

    ServiceNow

    Databricks

    Cisco

    Salesforce

    All exams and search

    Exams / SF-PDI / D1 User Interface

    D1.1

    User Interface (part 1 of 2)

    • 2 min read
    • 5 sections
    • 33 questions
    • Free preview
    • Exam domain: User Interface
    You are reading a free preview. The rest of the SF-PDI course unlocks with an Exam pass or All access.See plans

    Aura components as actions, overrides and page components

    Goal What to implement
    Custom (quick) action in Lightning Experience force:lightningQuickAction (panel with standard controls such as Cancel); force:lightningQuickActionWithoutHeader for your own header and footer; the two cannot be combined
    Override View, New, Edit or Tab lightning:actionOverride, then select it manually in Setup
    Place on a Lightning App Builder page flexipage:availableForAllPageTypes (or flexipage:availableForRecordHome for record pages only)
    Know the current record Id / object force:hasRecordId / force:hasSObjectName (sets sObjectName only in an explicit record context)
    • A custom action needs a default value for every required attribute.
    • A design resource (design:component, design:attribute, sfdc:objects) exposes properties to App Builder and can limit the component to some objects.
    • Classic cannot render a Lightning component: wrap it in a Visualforce page with <apex:includeLightning/> (Lightning Components for Visualforce, based on Lightning Out).

    Edit override in Lightning and Classic

    Apex controllers for Aura

    • Methods must be public or global, static and annotated @AuraEnabled; non-static methods are not supported.
    • The class must be wired through the controller attribute of aura:component; the client calls cmp.get("c.methodName").
    • A returned custom class serializes only its @AuraEnabled instance properties and methods.
    • RemoteAction is the Visualforce equivalent, not used by Aura.

    Visualforce messages and view state

    Component Shows
    apex:pageMessages All messages of the page, including ApexPages.addMessage() ones
    apex:pageMessage One custom message with Salesforce styling and a severity
    apex:message A message for one component (for attribute)

    Message components

    • GET request order: controller/extension constructors, then custom components (and their constructors), then view state if apex:form exists, then the HTML response.
    • transient and static variables are not transmitted in the view state; public and private instance variables are.
    • renderAs="pdf" renders a page as PDF: a classic reason to choose Visualforce.
    • Runtime field lists use Schema describe (Schema.describeSObjects()), not Schema Builder or Metadata API.

    Locale and internationalization

    Need Tool
    Date to locale String in Apex Date.format() (Date.parse() is the reverse)
    Locale-formatted values from a query SOQL FORMAT()
    Aura locale info $Locale value provider
    Multi-language text / multi-currency Custom Labels, Translation Workbench, convertCurrency()

    Lightning Web Components

    • Layout: size is for small screens; medium-device-size applies to tablets and larger; attributes are additive.

    Breakpoints

    • Child to parent: new CustomEvent('passthrough', { detail: this.passthrough }), then this.dispatchEvent(...); the parent reads event.detail.
    • Quick action: target lightning__RecordAction with a matching targetConfig; actionType="ScreenAction" opens a modal (default), Action is headless.
    • lightning-record-edit-form shows errors with lightning-messages placed before or after the lightning-input-field elements.
    • Field-level errors in Aura: ui:inputDefaultError (legacy, now deprecated).

    Exam traps

    • pageMessages (plural) vs pageMessage vs message: different scopes.
    • Aura Apex method forgotten as non-static or without @AuraEnabled.
    • Overriding Edit for Classic users needs a Visualforce page, not the component itself.
    • Layout: largeDeviceSize alone leaves tablets at the size value.
    • Static and transient are both outside view state.
    • View state limit: bank answer 135 KB; recent docs state a larger limit (unverified here).

    Docs

    The rest of this chapter is part of the SF-PDI premium course

    Unlock every chapter, all 422 questions and spaced review with All access or a 90-day exam pass. Every Fundamentals exam stays free, and the first chapter of every exam is open.

    Chapters