GithubHelp home page GithubHelp logo

leshchukandrej / salesforce-environment-vars Goto Github PK

View Code? Open in Web Editor NEW

This project forked from callawaycloud/salesforce-environment-vars

0.0 0.0 0.0 32.68 MB

A simple solution for managing environment variables in salesforce

License: MIT License

Apex 14.02% JavaScript 0.15% TypeScript 85.28% Less 0.55%

salesforce-environment-vars's Introduction

Salesforce Environment Variables

A simple library which uses Custom Metadata to manage simple Key/Value Environment variables. Includes a custom UI to make configuration as easy & error free as possible.

UI

📦 Install

via sfdx-cli sfdx force:package:install --package 04t1C000000lIDuQAM -u [email protected]

via url login and navigate to /packaging/installPackage.apexp?p0=04t1C000000lIDuQAM. Choose Install for: Admin Only.

Upgrading

This project has been updated to a namespaced unlocked package. If you installed before the namespace was added, and want to stay up-to-sync with the latest improvements, then please follow the manual migration process!

🔨 Usage

  1. Open Environment Variables from the app switcher (or "tabs" in classic)
  2. Add and Save some env-vars
  3. Use in Apex, Formulas or javascript applications.

Apex

//basic usage
Map<String,String> fieldMap = (Map<String,String>) VARS.ENV.get('MY_MAP');

//with a string transform
Map<String,String> fieldMap = (String[]) VARS.ENV.get('MY_ARRAY', VARS.ENV.Transform.TO_LOWER);

// with ANY json
Foo fieldMap = (Foo) VARS.ENV.get('MY_FOO', Foo.class);

Formula

$CustomMetadata.VARS__ENV__mdt.FIELD_MAP.Val__c

Note: Only the first 255 characters will be returned in formula!

✨Features

Currently supports the following types:

  • String
  • Integer
  • Decimal
  • Boolean: Format: true or false
  • String[]: Format: ["a","b","c"]
  • Map<String,String>: Format: {"456":"xyz","123":"abc"}
  • ANY: Any valid JSON string

Copy apex/formula code to clipboard

copy code

"Type-checking" to prevent user input errors

  • Simple type checking on primitive types.
  • ability to apply JSON Schema to ANY json type!

type checking

"Secret" Values Support (Optional)

Salesforce_-_Unlimited_Edition

In order to enable, follow these instructions.

Quick Find

Quickly filter VARS based on either key or value string search.

Auto-formatting of JSON types

Automatically formats JSON after editing

Ability to group like "VARS" together

https___drive-connect-5888-dev-ed--vars_visualforce_com_apex_env_vars_local_1

Ability to add Notes

Add information about how it's used, how to manage it, etc

notes

🤝 Contributing/Modifying

Project Overview:

  • env-vars: Salesforce metadata for core env-vars functionality
  • app: React UI for managing env-vars. Uses B.A.S.S. Stack
  • env-vars-encrypt: managed package to allow for "secret" vars
  • sf-env-vars-npm: npm package to make using env-vars easy in js applications

** Powered by ** Callaway Cloud Consulting

salesforce-environment-vars's People

Contributors

chuckjonas avatar leshchukandrej 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.