Skip to content

Instantly share code, notes, and snippets.


Charlie Jonas ChuckJonas

  • Callaway Cloud Consulting
  • Jackson Wy
View GitHub Profile


Provide a way to deserailize to a typed apex class, while also accessing any data for keys which were unmapped.



class Foo {
ChuckJonas /
Last active Feb 13, 2020
ts-force redesign


interface SObject{
  id: string;
  name: string;
  // everything else optional

interface ServiceFactory<T extends SObject> {
// Modeled after example found here:
// Expanded to show how an interface might help overcome some of the limits around existing @Invokable implementation
public class AccountInsertInvokable implements Invokable<Account, Id> {
private Boolean allOrNone;
private Boolean logFailures;
// @InvokableSetup this as a configuration point for ProcessBuilder/Flow
// Params Restricted to same types as @InvocableVariable
ChuckJonas / tasks.json
Last active Jul 11, 2019
salesforce vscode setup
View tasks.json
"version": "2.0.0",
"tasks": [
"label": "retrieve",
"type": "shell",
"command": "sfdx force:mdapi:retrieve -k deploy/package.xml -r deploy/",
"problemMatcher": []
ChuckJonas / sfdx-project.json
Last active Jun 28, 2019
Mavensmate -> salesforce-vscode Transition Files
View sfdx-project.json
"packageDirectories": [
"path": "src",
"default": true
"namespace": "",
"sfdcLoginUrl": "",
"sourceApiVersion": "45.0"
// Author
// Replacement clone page which copies activity history
public with sharing class LeadCloneWithActivitiesController {
private SObjectDeepClone cloner; //cloning util
public Lead clone {get; private set;} //editable lead
public Metadata.Layout leadLayout {get; private set;} //layout
public Metadata.UiBehavior editEnum {
<apex:page tabStyle="Lead" standardController="Lead" extensions="LeadCloneWithActivitiesController" >
<apex:form >
<apex:sectionHeader title="Cloning" subtitle="{!Lead.Name} and Activities ({!clone.Tasks.size + clone.Events.size})" />
<apex:pageBlock title="Lead Clone" tabStyle="Lead" >
<apex:pageMessages />
<apex:pageBlockButtons >
<apex:commandButton value="Cancel" action="{!cancel}" />
<apex:commandButton value="Save" action="{!saveClone}" />
<apex:outputPanel rendered="{!leadLayout!=null && clone != null}">
ChuckJonas /
Last active Oct 27, 2018
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 ts-force-tutorial. cd into dir
  2. npm install
  3. npm install ts-force -S
View beerList.js
(function() {
const {$A} = window;
return {
"locationChange":function(component, event, helper) {
View beerListHelper.js
minAlcohol: 0,
getBeers: function (component, page) {
var searchKey = window.location.hash.substr(1);
page = page || 1;
var action = component.get("c.findAll");
"searchKey": searchKey,
"minAlcohol": this.minAlcohol,
"pageNumber": page