Skip to content

Instantly share code, notes, and snippets.

Avatar

Kevin Poorman codefriar

View GitHub Profile
View ClassExercises5.cls
public with sharing class WeekFiveClassExercises {
public static void allAboutSets() {
//Let's make a set
Set<String> cuisineTypes = new Set<String>();
//Why a set instead of a list? Usually because we need each entry in the collection to be unique.
//Perhaps we're creating a list of cuisines and it's possible we'll encounter the same one twice, but we don't want it to appear twice
View gist:5de5713b168ae0b30a0459e0b5f29d42
/**
* ContactTriggerHandler description
* @description this class is responbile for...
* @author Kevin Poorman
* @updated 8/26/19
*/
public with sharing class CommentingOnCodeExercise {
/**
View ESlomskiWeekFiveHomework.cls
public with sharing class WeekFiveHomework {
public static void setsReview(){
//Your assignment: Play with Sets!
// 1. Create a set of Strings and add at least 5 entries
Set<String> Colors = new Set<String>();
Colors.add('Pink');
View week4homework-redux.cls
public with sharing class WeekFourHomework {
//Let's practice calling different methods by writing our very own methods. You will write and save methods in the space below
//that call the existing methods you see already written here. Ready? Let's Go!
//Sample: Here is a public method that calls the getfavoriteColorsMethod below and prints the results to our debug log
public static void printOutFavoriteColorsDemo() {
List<String> favoriteColors = getFavoriteColors();
System.debug('Here are the favorite colors: ' + favoriteColors);
View Demo_PromiseUse.cls
/**
* Promise v2.0 - Kevin Poorman
* Thanks to Chuck Jonas!
* This class exists to demonstrate the usage of the Promise library.
*
*/
Public Class Demo_PromiseUse {
// This execute method optionally accepts a string param that is used to pass data into
// the intial promise step.
Public Void execute(String param) {
@codefriar
codefriar / Log.cls
Created Mar 28, 2017
Log.cls is a standardized log formatter for putting data into salesforce debug logs in a clean and efficient manner. The idea, is to make the debug data easy to find in the 1+ mb of text that each apex execution context can produce.
View Log.cls
/**
* Created by kpoorman on 3/25/17.
* Log provides standardized methods for logging data to
* debug logs in a structured, easy to find way.
* All methods are static by design. This should be 0 setup
* or at least 0 in code setup.
*
* Future versions may pull configuration from
* custom metadata #safeHarbor
*/
View ExampleCode.cls
public with sharing class ExampleCode {
public class exampleCodeException extends Exception {}
Public Integer add(Integer one, Integer two){
return one + two;
}
Public Decimal divide(Integer one, Integer two){
if(two == 0){
throw new exampleCodeException('Dividing by Zero makes Astro Cry');
@codefriar
codefriar / Invocable_TriggerMCEvent.cls
Last active Feb 11, 2020
MCMessagingUtils is an Apex class used to trigger journey builder actions and push messages from Salesforce service and sales cloud.
View Invocable_TriggerMCEvent.cls
public with sharing class Invocable_TriggerMCEvent {
@InvocableMethod(label='Send Message with new Comment to Reporter' description='Send Message with new Comment to Reporter')
public static void TriggerMCEvent(List<String> contactKey) {
MCMessagingUtils.triggerMCInteractionEvent(contactKey[0]);
}
}
@codefriar
codefriar / DestroyAllTheThings.cls
Created Apr 12, 2016 — forked from joshbirk/DestroyAllTheThings.cls
Simple class to try and destroy all records in a Salesforce instance. Does not currently destroy Apex, or Visualforce, or Lightning components. It probably will never do the latter, I'm not sure I want it to do the former. Does not destroy custom metadata, but I'm looking into it. TODO: Parameters to avoid limits.
View DestroyAllTheThings.cls
public class DestroyAllTheThings {
public DestroyAllTheThings() {}
public void destroySimpleCRMStuff() {
//First clear out known dependents, leads and cases etc.
View Error.txt
Line 6: Cannot invoke 'MKCircle.Type.init' with an argument list of type '(centerCoordinate: CLLocationCoordinate2D, radius:CLLocationDistance)
You can’t perform that action at this time.