Skip to content

Instantly share code, notes, and snippets.

View ralphcallaway's full-sized avatar

Ralph Callaway ralphcallaway

View GitHub Profile
<?xml version="1.0" encoding="UTF-8"?>
<xsd:schema elementFormDefault="qualified" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:tns="http://soap.sforce.com/2006/04/metadata" targetNamespace="http://soap.sforce.com/2006/04/metadata">
<xsd:complexType name="Metadata">
<xsd:sequence>
<xsd:element name="fullName" minOccurs="0" type="xsd:string" />
</xsd:sequence>
</xsd:complexType>
<xsd:complexType name="AIApplication">
<xsd:complexContent>
<xsd:extension base="tns:Metadata">
@ralphcallaway
ralphcallaway / metadata54_from_wsdl.xsd
Last active April 19, 2022 10:57
Make a metadata schema based on v54.0 metadata wsdl
<?xml version="1.0" encoding="UTF-8"?>
<!--
Salesforce.com Metadata XSD for API version 54.0 based on v 54.0 WSDL
Copyright 2006-2016 Salesforce.com, inc. All Rights Reserved
-->
<!--
Salesforce.com Metadata API version 54.0
Copyright 2006-2022 Salesforce.com, inc. All Rights Reserved
-->
@ralphcallaway
ralphcallaway / tutorial.md
Last active October 29, 2018 16:27 — forked from ChuckJonas/tutorial.md
ts-force tutorial

ts-force tutorial

This tutorial will walk will cover the basics of using ts-force. While quite a bit of functionality is not covered, I've tried to include the most common use cases.

install & configuration

Before starting, make sure you have the sfdx-cli install and a developer throw away org authenticated.

  1. git clone https://github.com/ChuckJonas/ts-scratch-paper.git ts-force-tutorial. cd into dir
  2. npm install
  3. npm install ts-force -S
@ralphcallaway
ralphcallaway / gist:8030d33a5aedec52603a
Created January 4, 2016 22:53
submitted on behalf of sr
Step 2 - Deploy
[21:13:25] ~/CCC_AntScripts> ant deploy -Ddir=/Users/rwc/CCC_AntScripts/SC -Dprop=/Users/rwc/CCC_AntScripts/buildRWCskuid.properties
Buildfile: /Users/rwc/CCC_AntScripts/build.xml
deploy:
[input] Deploying to rwcSkuid@gmail.com Are you sure? (y, n)
y
[echo] Deploying /Users/rwc/CCC_AntScripts/SC from rwcSkuid@gmail.com
[sf:deploy] Request for a deploy submitted successfully.
@ralphcallaway
ralphcallaway / AccountHierarchy.cls
Created October 25, 2013 17:13
Sample code for working with account hierarchies
/*
Developer: Ralph Callaway <ralph@callawaycloudconsulting.com>
Description:
Representation of an account hierarchy.
*/
public class AccountHierarchy {
/* Variables */
private Boolean accountsLoaded = false;
@ralphcallaway
ralphcallaway / destructiveChanges.xml
Created February 25, 2013 23:39
Clean a new Salesforce dev org
<?xml version="1.0" encoding="UTF-8"?>
<Package xmlns="http://soap.sforce.com/2006/04/metadata">
<version>26.0</version>
</Package>
/*
Developer: Ralph Callaway <ralph@callawaycloudconsulting.com>
Description: Helper methods for dynamic DML
*/
public class DynamicDMLHelper {
public static Object recursiveGet(sObject record, String field) {
if(field.contains('.')) {
Integer firstPeriod = field.indexOf('.');
String nextObjectName = field.subString(0, firstPeriod);
git config --global alias.ls 'log --pretty=format:"%C(yellow)%h%Cred%d\\ %Creset%s%Cblue\\ [%cn]" --decorate'
git config --global alias.ll 'log --pretty=format:%C(yellow)%h%Cred%d\ %Creset%s%Cblue\ [%cn] --decorate --numstat'
git config --global alias.lnc 'log --pretty=format:%h\ %s\ [%cn]'
git config --global alias.lds 'log --pretty=format:%C(yellow)%h\ %ad%Cred%d\ %Creset%s%Cblue\ [%cn] --decorate --date=short'
git config --global alias.ld 'log --pretty=format:%C(yellow)%h\ %ad%Cred%d\ %Creset%s%Cblue\ [%cn] --decorate --date=relative'
git config --global alias.le 'log --oneline --decorate'
git config --global alias.assume 'update-index --assume-unchanged'
git config --global alias.unassume 'update-index --no-assume-unchanged'
git config --global alias.assumed '!git ls-files -v | grep ^h | cut -c 3-'
git config --global alias.unassumeall '!git assumed | xargs git update-index --no-assume-unchanged'
@ralphcallaway
ralphcallaway / AnotherWay.html
Created November 26, 2012 16:02
Alternative Implementation of Client Preferces
<apex:form >
<apex:pageBlock id="cp_module" rendered="{!detailKey = 'cp'}" title="Client Preferences" mode="edit">
<apex:pageblockButtons location="top">
<apex:commandButton value="Edit" rendered="{!NOT(clientPreferencesModification)}"
rerender="cp_module" status="LoadingStatusSpinner">
<apex:param assignTo="{!clientPreferencesModification}" value="true"/>
</apex:commandButton>
<apex:commandButton value="Save" rendered="{!clientPreferencesModification}"
action="{!saveClientPreferences}" status="LoadingStatusSpinner"
rerender="cp_module, im_counts"/>
@ralphcallaway
ralphcallaway / AccountView.cls.java
Created November 21, 2012 21:28
Massive Internal View State (file extensions changed to assist with language auto-detection) See http://salesforce.stackexchange.com/questions/4537/how-to-reduce-a-large-internal-view-state-what-is-in-the-internal-view-state for related discussion
/* NB: Class has been edited for brevity and may not compile initially */
public with sharing class AccountView {
// Input Properties
public String filter1 { get; set; }
public String grouping1 { get; set; }
public String grouping2 { get; set; }
// Select Lists