GithubHelp home page GithubHelp logo

automation-settings's Introduction

automation-settings

Custom Setting for managing disabling automations in Salesforce

Apex Triggers

Should be incorporated into a centralised Trigger Handler.

if (Automation_Settings__c.getInstance().Disable_Triggers__c) {
    // Don't run trigger
    return;
}

Process Builder

All Process Builders should have the Custom Setting evaluation check at the START of the PB. This ensures that the Custom Setting condition doesn’t need to be embedded into every condition on the Process Builder.

Example as follows:

  1. Process Builder Disabled is the first condition in the Process Builder
  2. It uses a formula evaluation to return TRUE if the Custom Setting to DISABLE Process Builder is ENABLED
  3. Using the STOP decision at the end of evaluation will cause nothing else in the Process Builder to run
  4. The “Do Nothing” action only exists because an Immediate Action is required by Process Builder. This quite literally does nothing (it calls a blank Apex method).

PB PB

Record-Triggered Flows

All Record-Triggered Flows should also have a condition added to the start to only execute logic if Flows ARE NOT disabled.

This is similar to Process Builder above, and requires a condition added to the start of each Flow.

Note: This should also be added to added to any Scheduled Flows or Autolaunched Flows that are executed from Apex or other jobs.

  1. First element of the Flow should evaluate the Custom Setting
  2. If NOT disabled, continue with rest of Flow of logic.

Flow Flow

Workflow Rules

AND(
    NOT($Setup.Automation_Settings__c.Disable_Workflow__c),
    ... other condtions
)

OR

NOT($Setup.Automation_Settings__c.Disable_Workflow__c)

&&

... other conditions

Validation Rules

AND(
    NOT($Setup.Automation_Settings__c.Disable_Validations__c),
    ... other condtions
)

OR

NOT($Setup.Automation_Settings__c.Disable_Validations__c)

&&

... other conditions

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.