Toggle Field Button

Lightning Record Page Component

Installation - Install in Production

Sandbox - Install in a Sandbox

Source Code - Source code repository

Created by Eric Smith - January 2019

ersToggleField

This is a generic Lightning Component that allows a Toggle Button to set/clear a checkbox field. The Button can be placed anywhere on a Lightning Record Page.

Using the Component

You can use this Lightning Component on a Record Page

Parameters

(Required)

  • Name of Field to Update - API Name of the checkbox field
  • Toggle Button Label - Text to appear to the left of the toggle button
  • Toggle Button Active Message - Text to appear under the Active toggle
  • Toggle Button Inactive Message - Text to appear under the Inactive toggle

Sample Usage

Here a Toggle is being added to a Record Page to change what is being displayed. The Record Page components are filtered based on the value of the toggled field


The value of the field being toggled can be used to filter which components are displayed on the page.


This is what the page looks like when the toggle is inactive.


This is what the page looks like when the toggle is active.