Skip to content

Instantly share code, notes, and snippets.

View cdcarter's full-sized avatar

Christian Carter cdcarter

View GitHub Profile
@cdcarter
cdcarter / Donor Analysis Formula
Created February 19, 2016 16:41
donor analysis formula
IF( npo02__TotalOppAmount__c = 0, "Non-Donor",
IF( npo02__OppAmountThisYear__c > 0 && npo02__OppAmountThisYear__c = npo02__TotalOppAmount__c, "New",
IF( npo02__OppAmountThisYear__c > npo02__OppAmountLastYear__c && npo02__OppAmountLastYear__c != 0, "Increased",
IF( npo02__OppAmountThisYear__c < npo02__OppAmountLastYear__c && npo02__OppAmountThisYear__c != 0, "Decreased",
IF( (npo02__OppAmountLastYear__c != 0 || (npo02__OppAmountLastYear__c = 0 && npo02__TotalOppAmount__c != 0)) && npo02__OppAmountThisYear__c = 0, "Lapsed",
IF( npo02__OppAmountThisYear__c = npo02__OppAmountLastYear__c && npo02__OppAmountLastYear__c != 0, "Renewed",
IF( npo02__OppAmountThisYear__c > 0 && npo02__OppAmountLastYear__c = 0 && npo02__TotalOppAmount__c > 0 && (npo02__TotalOppAmount__c != npo02__OppAmountThisYear__c), "Recovered","Error"
)
)
)
@cdcarter
cdcarter / song.txt
Created January 23, 2016 21:56
50 ways to call your apex
"The problem is all inside your head" Marc said to me
"The answer is easy if you take it logically
I'd like to help you in your struggle to be free
There must be fifty ways to call your Apex"
Parker said "It's really not my habit to intrude
Furthermore, I hope my meaning won't be lost or misconstrued
But I'll repeat myself at the risk of being crude
There must be fifty ways to call your Apex
Fifty ways to call your Apex"
{"response_type":"ephemeral","attachments":[{"title":"Annual Campaign Statstics","fields":[{"title":"Donors","value":"342"},{"title":"Donations",value="371"},{"title":"Amount","value","$37,040"},{"title":"Amount Remaining","value":"$12,960"}]}]}
@cdcarter
cdcarter / slackbot.java
Last active January 16, 2016 18:01
NPSP-Slack-Bot
/**
* @author Christian Carter (@cdcarter)
* @date Jan 2016
*
*
* @description A simple NPSP Slack slashcommand to show you the number of new donations today!
* This is a "my first slackbot" condition class, it doesn't check auth tokens, it doesn't check which
* command was called, but it'll get us started!
*/
@cdcarter
cdcarter / swagger.json
Created January 4, 2016 22:18
pm-swagger
{
"swagger": "2.0",
"info": {
"title": "Public Metrics",
"description": "Public Metrics creates public facing APIs and dashboards for key metrics tracked in Salesforce with a declarative and easy to set up process. This document defines the public API generated by the package.",
"version": "0.0.1"
},
"host": "public-metrics-1-developer-edition.na22.force.com",
"schemes": [
"https"
@cdcarter
cdcarter / .gitignore
Created December 1, 2015 21:37
salesforce gitignore
config/
*.sublime-*
.gitignore
apex-scripts/*
debug/
@cdcarter
cdcarter / stg_header.jsf
Created November 1, 2015 20:07
slds breadcrumbs weird
<apex:page standardStylesheets="false" applyBodyTag="false" docType="html-5.0">
<html xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<apex:stylesheet value="{!URLFOR($Resource.SLDS0101, 'assets/styles/salesforce-lightning-design-system-vf.css')}" />
<body>
<apex:form styleClass="slds">
<div class="slds-page-header" role="banner">
<nav class="slds-m-bottom--xx-small" role="navigation">
<p id="bread-crumb-label" class="slds-assistive-text">You are here:</p>
<ol class="slds-breadcrumb slds-list--horizontal" aria-labelledby="bread-crumb-label">
<li class="slds-list__item slds-text-heading--label"><a href="">Volunteers Settings</a></li>
@cdcarter
cdcarter / .gitignore
Created October 15, 2015 17:40
mavensmate gitignore
config/
*.sublime-*
.gitignore
apex-scripts/*
deploy/
*DS_Store*
@cdcarter
cdcarter / map.jsf
Last active October 9, 2015 15:41
Custom Object Page Layout Map
<apex:page standardController="Venue__c">
<apex:map width="400px" height="400px" mapType="roadmap"
center="{!Venue__c.City__c},{!Venue__c.State__c}">
<apex:mapMarker title="{! Venue__c.Name }"
position="{!Venue__c.Street__c},{!Venue__c.City__c},{!Venue__c.State__c}"/>
</apex:map>
</apex:page>
IF( ISBLANK(Parent.Parent.Parent.Parent.Name),
IF(ISBLANK(Parent.Parent.Parent.Name),
IF(ISBLANK(Parent.Parent.Name),
IF(ISBLANK(Parent.Name),
Name,
Parent.Name),
Parent.Parent.Name),
Parent.Parent.Parent.Name),
Parent.Parent.Parent.Parent.Name)