Editing Records In Real Time

With the ultimate version of Flow Data Table, it is possible to edit records in the data table and save them to your Salesforce Org in real time with validation rules enforced.

In this guide, we will extend the flow from the getting started guide to enable real time database editing and demonstrate how the table enforces validation rules.

Creating The Validation Rule

Lets create the validation rule first. Under setup:

  1. Go to Object Manager
  2. Click Account
  3. Click Validation Rules
  4. Click New
  5. Fill out the Account Validation Rule form as follows:
    Rule Name: citynameuppercase_first
    Description: Ensure the first character of billing city is uppercase.
    Error Condition Formula: LOWER(LEFT( BillingCity, 1)) = LEFT( BillingCity, 1)
    Error Message: Please ensure the first character of the billing city is uppercase.
  6. Ensure your validation rule form looks like the screenshot below and click Save

Updating The Flow

Now that the validation rule is added, lets update the flow to enable real time editing. Under setup:

  1. Type Flows in the quick find box
  2. Click Flows
  3. Click Open on the Accounts flow that was built in the getting started guide
  4. Double click on the Accounts Table element
  5. Select the AccountsTableCmp component
  6. In the right pane, scroll down to Table Mode and select Database Editing
  7. Click Done
  8. Save the flow
  9. Run the flow
  10. Name one of the Billing Cities Chicago and another baltimore
  11. Click Save

The table should save the billing city set to Chicago in the database. However, the billing city set to baltimore should not have been saved and an error message should be shown.

  1. Change baltimore to Baltimore
  2. Click Save

The error message should be removed from the table. You can open up another tab and navigate to the account detail pages to verify the records have been updated and match the data table field values.