Coder Social home page Coder Social logo

dschibster / bighistory Goto Github PK

View Code? Open in Web Editor NEW

This project forked from dannysummerlin/bighistory

0.0 0.0 0.0 74 KB

a template for making a more effective field audit tool in Salesforce using Big Objects

License: GNU General Public License v3.0

JavaScript 12.85% Apex 87.15%

bighistory's Introduction

BigHistory

If you have ever wanted to track more than 20 Field Histories on one sObject, BigHistory is here for you! Use Big Objects to audit all your fields with an Apex Action for Flow and a Lightning Component for your pages

Version 1.0:

Use

Flow Action

You can use the BigHistory class in an Apex trigger, but the best way to use it is with Record-Triggered Flows.

  1. Using a Record-Triggered Flow you can take advantage of the new $Record and $Record__Prior variables (with a caveat, see Known Issues) to automatically capture all updated values
    Record Triggered Flow
  2. Some quirk of Flow doesn't hand $Record__Prior to the Apex as a true sObject, so you need to first create a wrapper "Record" variable of the same type as the $Record itself
    copy Record__prior
  3. After that you add the BigHistory action. The "Original Record" input field is marked as optional to accomodate blank data when a record is first created, but it is necessary to catch any changes
    Add BigHistory Action
  4. The simplest Flow will look something like this:
    Simple Flow

Lightning Component

You can then add the BigHistoryList Lightning Component to Record Pages to see the history.

Lightning Component

If there are sensitive fields you do not want listed in the field history you can use a comma-separated list of field API names in the Exclusion List field.

Known Issues/Caveats

  • Record__Prior - must be assigned to a Flow variable. For some reason Flow does not treat Record__Prior as a true sObject when handing off to Apex, so it must be copied into a holder variable
  • Security - be aware of BigObject security, which is everything for everyone. Big Objects don't have sharing rules, so be sure that anyone who has access to the Big Object has clearance to see the recorded fields. UPDATE: you can use the inclusive and exclusive field lists in both the Action and the Lightning Component to further restrict what is recorded and what is displayed
  • Merge handling - be aware history will not be transfered when records are merged. The entries associated with the original record will still exist, but you will have to know the old record ID and do custom Big Object query in order to see them

Roadmap/Future

  • Add report summary Custom Object with query options built-in
  • Look for ways to handle merge data better, may require an ondelete something, trigger or flow
  • Add "Include Fields" to Lightning Component for when there are fewer fields you want tracked than you want excluded

bighistory's People

Contributors

dannysummerlin avatar dannysummerlinjstartorg avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.