Visualforce & Lightning Experience -  Explore the Visualforce App Container
44 Questions
0 Views

Choose a study mode

Play Quiz
Study Flashcards
Spaced Repetition
Chat to lesson

Podcast

Play an AI-generated podcast conversation about this lesson

Questions and Answers

What does the Lightning Experience application use to load its resources?

  • Static HTML shell and a lot of JavaScript (correct)
  • Dynamic HTML shell and PHP
  • Static HTML shell and CSS
  • Dynamic HTML shell and JavaScript Frameworks
  • What is the URL used to access the Lightning Experience application?

  • /lightning (correct)
  • /storm
  • /flash
  • /lightning-application
  • In the context of Lightning Experience, which statement is true regarding Visualforce pages?

  • Visualforce pages are independent of Lightning Experience.
  • Visualforce pages control the request.
  • Visualforce pages cannot be used with Lightning Experience.
  • Visualforce pages work within constraints imposed by Lightning Experience. (correct)
  • How does the browser affect the performance of a Visualforce page in Lightning Experience?

    <p>The browser enforces security and JavaScript execution constraints.</p> Signup and view all the answers

    Which of the following describes the relationship between Lightning Experience and Visualforce pages?

    <p>Lightning Experience is the parent context while Visualforce pages are the child context.</p> Signup and view all the answers

    What does the implementation of Lightning Experience imply for developers working with Visualforce?

    <p>Developers must work within evolving constraints set by Lightning Experience.</p> Signup and view all the answers

    Which aspect of JavaScript errors is highlighted in relation to Lightning Experience?

    <p>JavaScript errors are harder to discover but there are general rules for managing them.</p> Signup and view all the answers

    What is the primary type of application that Lightning Experience is characterized as?

    <p>Single-page application (SPA)</p> Signup and view all the answers

    What is one significant change in how Visualforce operates between Salesforce Classic and Lightning Experience?

    <p>Visualforce pages run inside an iframe within the Lightning container.</p> Signup and view all the answers

    Which of the following accurately describes the execution context of Visualforce pages in Lightning Experience?

    <p>They are executed in a shared SPA environment.</p> Signup and view all the answers

    Which of these is a recommended adjustment for Visualforce code when transitioning to Lightning Experience?

    <p>Update code patterns to comply with SPA standards.</p> Signup and view all the answers

    What is a notable difference in default values for Visualforce pages when running in Lightning Experience compared to Salesforce Classic?

    <p>Default access permissions become more restrictive.</p> Signup and view all the answers

    What does the Lightning Experience application structure predominantly represent?

    <p>A single-page application that streams content dynamically.</p> Signup and view all the answers

    Which element of Visualforce's functionality is impacted by its new context in Lightning Experience?

    <p>Interactions with other components in Salesforce.</p> Signup and view all the answers

    Which aspect of page rendering is primarily altered when Visualforce pages move to Lightning Experience?

    <p>Rendering occurs within a contained environment.</p> Signup and view all the answers

    How does Visualforce's role change within Lightning Experience compared to Salesforce Classic?

    <p>It serves only as a sub-component of the application.</p> Signup and view all the answers

    What happens to the standard Salesforce Classic header and sidebar when Visualforce pages run in Lightning Experience?

    <p>They are always suppressed.</p> Signup and view all the answers

    Which attribute controls the inclusion or suppression of standard Salesforce Classic stylesheets in Lightning Experience?

    <p>standardStylesheets</p> Signup and view all the answers

    What effect do the showHeader and sidebar attributes have on Visualforce pages running in Lightning Experience?

    <p>They have no effect at all.</p> Signup and view all the answers

    What distinguishes the sforce.one JavaScript Utility Object?

    <p>It provides navigation-related functions.</p> Signup and view all the answers

    How does the presence of sforce.one affect Visualforce pages in Lightning Experience?

    <p>It enables navigation events without additional setup.</p> Signup and view all the answers

    What will happen if a page is shared between Salesforce Classic and Lightning Experience regarding the attributes showHeader and sidebar?

    <p>They can be set for Salesforce Classic views only.</p> Signup and view all the answers

    Why can't the Lightning Experience header or sidebar be suppressed?

    <p>There are no corresponding attributes for suppression.</p> Signup and view all the answers

    What is the default state of the standardStylesheets attribute when running in Lightning Experience?

    <p>True</p> Signup and view all the answers

    What is the primary role of Lightning Experience in relation to Visualforce pages?

    <p>Lightning Experience acts as the parent context for Visualforce pages.</p> Signup and view all the answers

    What is one disadvantage of Visualforce pages running inside an iframe in Lightning Experience?

    <p>Limited ability to access the top-level browsing context.</p> Signup and view all the answers

    What should you consider updating when a Visualforce page communicates with services besides Salesforce?

    <p>The organization’s CORS settings.</p> Signup and view all the answers

    Which of the following is NOT an element of security that might be affected by the new Visualforce container in Lightning Experience?

    <p>Access control lists (ACL).</p> Signup and view all the answers

    What is the distinction between the browsing context of Lightning Experience and the Visualforce page?

    <p>The Visualforce page runs in an iframe, creating a separate browsing context.</p> Signup and view all the answers

    Which of the following statements regarding JavaScript errors in this context is true?

    <p>Diagnosis of JavaScript errors can be challenging.</p> Signup and view all the answers

    When Visualforce pages operate within Lightning Experience, what aspect is NOT a concern for those pages?

    <p>Interacting with external APIs seamlessly.</p> Signup and view all the answers

    What is one of the main advantages of running Visualforce pages inside an iframe from Lightning Experience's perspective?

    <p>They help maintain a consistent appearance similar to Salesforce Classic.</p> Signup and view all the answers

    What happens if a Visualforce page needs to access external services while running inside an iframe?

    <p>It may encounter issues due to cross-origin restrictions.</p> Signup and view all the answers

    Which statement best summarizes the parent-child relationship between Lightning Experience and Visualforce pages?

    <p>Visualforce pages must operate within the constraints set by Lightning Experience.</p> Signup and view all the answers

    What is the purpose of the $Api.Session_ID global variable?

    <p>It holds a unique session token for browser requests.</p> Signup and view all the answers

    What happens to the session ID when crossing hostname boundaries?

    <p>A new session ID is generated.</p> Signup and view all the answers

    Why should developers avoid manipulating window.location in Lightning Experience?

    <p>It can interfere with DOM access from other contexts.</p> Signup and view all the answers

    What is the recommended method for interacting across frame boundaries in Lightning Experience?

    <p>Using window.postMessage for cross-context communication.</p> Signup and view all the answers

    What principle should developers adhere to regarding JavaScript scope in Lightning Experience?

    <p>Avoid accessing or modifying DOM elements outside your context.</p> Signup and view all the answers

    What change occurs automatically when Visualforce pages run within Lightning Experience?

    <p>Low-level environment changes enable compatibility.</p> Signup and view all the answers

    What is a common misconception regarding session management in Lightning Experience?

    <p>Session IDs remain unchanged across requests.</p> Signup and view all the answers

    How does the same-origin policy affect Visualforce and Lightning Experience?

    <p>It creates security barriers preventing code access across domains.</p> Signup and view all the answers

    What is an action developers should not take regarding session IDs?

    <p>Pass session IDs between different domains manually.</p> Signup and view all the answers

    What should experienced JavaScript developers be cautious of when working with Visualforce in Lightning Experience?

    <p>Using certain code patterns like contentWindow that may lead to issues.</p> Signup and view all the answers

    Study Notes

    Lightning Experience Overview

    • Lightning Experience is a single-page application (SPA) accessed via the /lightning URL.
    • Upon loading, the application code takes over the environment after the resources (HTML and JavaScript) load.

    Application Startup Process

    • The startup process for a SPA is both interesting and complex, typically involving a static HTML shell and a large amount of JavaScript.
    • Familiarity with frameworks like AngularJS or React can provide insights into how Lightning Experience operates.

    Visualforce Interaction

    • Lightning Experience governs the request, meaning that it is the parent context while the Visualforce page functions as the child context.
    • Visualforce pages must adhere to constraints imposed by Lightning Experience, as children are expected to obey their parents.

    Constraints on Visualforce Pages

    • Some constraints come directly from Lightning Experience, such as the size of the frame used to display Visualforce pages.
    • Implicit constraints may arise from the browser itself, focusing on security and JavaScript execution.
    • Most pages are generally unaffected by security constraints; those that are usually fail early with clear error messages.
    • JavaScript errors can be more nuanced, making them harder to diagnose, but general rules exist to mitigate these issues.

    Visualforce in Salesforce Classic vs. Lightning Experience

    • Visualforce pages in Salesforce Classic own the page and environment, while in Lightning Experience, they run inside an iframe in a larger container.
    • Lightning Experience is a single-page application (SPA) that manages the request, creating specific constraints for Visualforce pages.
    • The execution context changes how Visualforce pages interact with the overall Salesforce application.

    Changes in Visualforce Page Functionality

    • Visualforce runs in an iframe, isolating it from the parent Lightning Experience context, which means some pages may require updates to access top-level browsing context.
    • Common code patterns needing updates include session handling and JavaScript scope adjustments due to the iframe boundaries and security policies.

    Security and Scope Impacts

    • Session maintenance and renewal must be considered due to differing session IDs between the Visualforce iframe and Lightning Experience.
    • Cross-domain requests can lead to issues, necessitating proper configuration for CORS settings.
    • JavaScript code in Visualforce cannot manipulate DOM elements in the Lightning Experience context directly; it must follow the principle of not affecting other contexts.

    Visualforce Defaults in Lightning Experience

    • The standard Salesforce Classic header and sidebar are suppressed when Visualforce runs in Lightning Experience.
    • Attributes showHeader and sidebar are always set to false and cannot be overridden for Lightning Experience.
    • The standardStylesheets attribute defaults to true but can be altered.

    sforce.one JavaScript Utility Object

    • The sforce.one utility object is automatically added in Lightning Experience for navigation purposes, providing multiple useful functions.
    • It is not available in Salesforce Classic, highlighting a key difference in capabilities between the two environments.

    Considerations for Developers

    • Developers must analyze how their existing Visualforce code will behave in the new iframe context and adjust accordingly.
    • Understanding and adhering to security constraints will mitigate issues with cross-domain requests and API interactions.
    • To maintain effective navigation across frame boundaries, using methods like window.postMessage is necessary rather than relying on direct JavaScript access.

    Studying That Suits You

    Use AI to generate personalized quizzes and flashcards to suit your learning preferences.

    Quiz Team

    Description

    Explore the intricacies of the Lightning Experience application, a single-page application (SPA) accessed via the /lightning URL. This quiz examines how SPA structures load resources, focusing on the role of static HTML and JavaScript. Ideal for those familiar with JavaScript frameworks like AngularJS.

    Use Quizgecko on...
    Browser
    Browser