How to edit datatableLwcFsc for a different Object

For the latest on the Datatable component, please go here: Datatable – Lightning Web Component for Flow Screens – UnofficialSF

This should only be necessary with versions being used in Orgs prior to Summer ’20.

Lightning Web Components are not editable in the standard Developer Console. I recommend using Visual Studio Code (VS Code) with the Salesforce extensions to edit the source code. I also recommend that you deploy your changed versions in a Sandbox and use a Change Set to deploy them to Production.

To learn about VS Code and install it for your own use, complete this Trailhead.

You only need to update the Object name in 5 places in a single file (datatableLwcFsc_Object.js-meta.xml). Everything else stays the same.

Once you have VS Code installed and configured per the Trailhead, you can follow these steps to create a version of the datatable component for any object.

  1. Press Ctrl+Shift+P to view the Command Palette
  2. Select SFDX: Create Project with Manifest
    1. Select Standard
    2. Give the project a name (I recommend the name of your sandbox where you installed the installation package)
    3. Give it a parent folder location on a local drive (also the name of your sandbox)
  3. Press Ctrl+Shift+P to view the Command Palette
  4. Select SFDX: Authorize an Org
    1. Select Sandbox
    2. Enter your sandbox name
    3. Login to your sandbox in the new window that opens
    4. Select Allow Access
    5. After logging in you can close that window
  5. Click on >manifest in the left Explorer column
    1. Right-Click on package.xml
    2. Select SFDX: Retrieve Source in Manifest from Org
    3. Wait until the metadata is downloaded
  6. Click on >lwc in the left Explorer column
    1. Right-Click on one of the datatableLwcFsc_Object entries
    2. Select Copy
    3. Right-Click on the lwc Folder Name
    4. Select Paste
    5. Right-Click on the new datatableLwcFsc_Object copy folder name
    6. Select Rename
    7. If you see this dialog box, select No
    8. Rename the folder to datatableLwcFsc_NewObject
    9. Rename each of the 3 files in the folder, replacing the original Object name with the new Object name
  7. Select the datatableLwcFsc_NewObject.js-meta.xml file
    1. Change the Object name in the 5 highlighted locations.  If it is a custom Object, be sure to append __c to the Object name.
    2. Click on the Save icon (or Select File -> Save)
    3. Right-Click on the newly edited file and select SFDX: Deploy Source to Org
  8. To deploy your new component to Production, create an Outbound Change Set and Add the new Lightning Web Component Bundle to it.

4/2/20 – Eric Smith