Skip to content

Instantly share code, notes, and snippets.

View kenandersen's full-sized avatar

kenandersen

  • Washington D.C./New York City
View GitHub Profile
@kenandersen
kenandersen / Excel Formula to Convert 15-digit Salesforce IDs to 18-digit - Part 2.md
Created December 29, 2014 22:54
Formula 2 of 2 to convert a 15-digit ID to a 18-digit ID

= IF(LEN(A2)=18,

A2,

IF(LEN(A2)=15,

CONCATENATE(A2, (IF(LEFT(B2,5)="00000", "A", IF(LEFT(B2,5)="00001", "B",

@kenandersen
kenandersen / Excel Formula to Convert 15-digit Salesforce IDs to 18-digit - Part 1.md
Created December 29, 2014 22:51
Formula 1 of 2 to convert a 15-digit ID to a 18-digit ID

=IF(LEN(A2)=18,

A2,

IF(LEN(A2)=15,

CONCATENATE(

(IF((EXACT(LOWER((RIGHT(LEFT(A2,5),1))),(RIGHT(LEFT(A2,5),1)))),0,1)

@kenandersen
kenandersen / Access Modifiers in Apex for Salesforce.md
Last active August 29, 2015 14:08
A reference describing access modifiers in Salesforce's Apex language

Access Modifiers in Apex for Salesforce.md

####Header Apex has four different access modifiers when you define your classes and triggers and the subsequent methods and variables.

  1. Private
    • The default and most used access modifier. A method or variable with the modifier is only accessable within the Apex class (or trigger) in which its defined.
  2. Protected
    • This one is a little more open than Private. A method or variable with the Protected modifier is only accessable to any inner classes of the defining Apex and to classes that extend the defining Apex class.
  3. Public
    • One step up from Protected! (see the pattern?) Methods or variables with the Public modifier can be used by any Apex in the application or namespace (basically by within anything in your Salesforce org).
@kenandersen
kenandersen / Annotations in Apex for Salesforce.md
Last active August 29, 2015 14:08
A reference describing annotations in Salesforce's Apex language

Annotations in Apex for Salesforce.md

####Header Apex has six main types of annotations and six REST annotations. Annotations change the way a method or class is used. Annotations are denoted with an "@".

  1. @Deprecated
  • This is only used for managed packages (basically apps you install through the App Exchange).
  • It's fairly obvious, but it's used to mark a method, class, enum, etc. that can no longer be used.
  • What isn't obvious is that deprecated elements will be useable for existing subscribers and API integrations.
  • Nitty gritty rules:
  • webService methods and variables can't be deprecated.
@kenandersen
kenandersen / Collections in Apex for Salesforce.md
Last active August 29, 2015 14:08
A reference describing collections in Salesforce's Apex language

Collections in Apex for Salesforce.md

####Header Apex has three types of collections:

  1. Lists
  • A simple ordered list.
  1. Maps
  • A collection of key-value pairs. Keys and values are determined by the user. Lists are basically a map where they key is a number.
  1. Sets
  • A simple unordered list.
@kenandersen
kenandersen / My first markdown Gist.md
Created October 31, 2014 03:00
My attempt at creating an .md file

My first markdown Gist.md

Testing Markdown

BOLD

@kenandersen
kenandersen / My first Gist!
Last active August 29, 2015 14:08
Test Gist
My first Gist!
Testing the gist package for Sublime Text 3.
Update #1
*Update #2*
// Random terminal tip #1
//You'll see this message if you git commit without a message (-m)
// You can get out of it with two steps:
// 1.a. Type a multi-line message to move foward with the commit.
// 1.b. Leave blank to abort the commit.
// 2. Hit "esc" then type ":wq" and hit enter to save your choice. Viola!
# Please enter the commit message for your changes. Lines starting
# with '#' will be ignored, and an empty message aborts the commit.