Skip to content

Instantly share code, notes, and snippets.

View ImJohnMDaniel's full-sized avatar
😎
Making some code....

John M. Daniel ImJohnMDaniel

😎
Making some code....
View GitHub Profile
@ImJohnMDaniel
ImJohnMDaniel / foo.md
Created November 24, 2024 00:03
Why does this not work??

sf toolbox aep generate --at4dx -d -r -s COIPSAM_OrgAppInstallHistory__c -b 700 -u --target-org coipsam

$ sf toolbox aep generate --at4dx -d -r -s COIPSAM_OrgAppInstallHistory__c -b 700 -u --target-org coipsam (node:25100) [DEP0040] DeprecationWarning: The punycode module is deprecated. Please use a userland alternative instead. (Use node --trace-deprecation ... to show where the warning was created) Error (2): Flag --target-org expects a value

Error (2): Flag --target-org expects a value

@ImJohnMDaniel
ImJohnMDaniel / addApexCommon.sh
Last active August 8, 2023 01:59
addFrameworksToExistingProject
#!/bin/bash
###############################################################################
#
# addApexCommons.sh
#
# This is a utility shellscript will add the main Apex Commons code base to the
# sfdx-source/untracked/apex-commons folder of the current project. This is
# when trying to diagnose Apex Commons related issues.
#
@ImJohnMDaniel
ImJohnMDaniel / setupReleaseStagingBranch.sh
Created May 10, 2023 18:49
setupReleaseStagingBranch
#! /bin/bash
#
# setupReleaseStagingBranch.sh
#
# takes input from user and then creates a staging branch for the user based on input
#
# @usage
# setupReleaseStagingBranch.sh
#
# @example
@ImJohnMDaniel
ImJohnMDaniel / distilled-list-of-commands.txt
Last active September 27, 2023 02:19
Debug Trace Setups
Starting SFDX: Turn On Apex Debug Log for Replay Debugger
// Determine user to examine if trace exists yet -- 0058F000003hQzsQAE
// seem to be looking for logtype='DEVELOPER_LOG'
// need to update to new SF version of commands
sfdx force:data:soql:query --query SELECT id, logtype, startdate, expirationdate, debuglevelid, debuglevel.apexcode, debuglevel.visualforce FROM TraceFlag WHERE logtype='DEVELOPER_LOG' AND TracedEntityId='0058F000003hQzsQAE' --usetoolingapi --json --loglevel fatal
// response JSON
{
@ImJohnMDaniel
ImJohnMDaniel / ComplainceAPIDispatcher.cls
Last active February 20, 2023 14:25
And example concept of a single Apex REST api class that serves as a dispatcher to one or more Apex Service classes
// example URIs
// /services/apexrest/compliance/1.0/report
// /services/apexrest/compliance/1.1/report
// /services/apexrest/compliance/1.0/foobar
// /services/apexrest/compliance/1.0/verify
// /services/apexrest/compliance/2.0/verify
//
@RestResource(urlMapping='compliance/*')
global with sharing class ComplainceAPIDispatcher
{
#! /bin/bash
#
# closeoutReleaseBranch.sh
#
# takes the current branch that you are on and merges it to "main" branch and then deletes
# the current branch locally and on the remote (if allowed)
#
# @usage
# closeoutReleaseBranch.sh
#
public class DatabaseErrorWrapper
{
private Database.Error dbError = null;
private Boolean isTest = false;
private List<String> fields = null;
private String message = null;
private String statusCode = null;
public List<String> getFields()
public class DatabaseResultWrapper
{
private Boolean isSave = true;
private Database.DeleteResult deleteResult = null;
private Database.SaveResult saveResult = null;
private Boolean isTest = false;
private Id sobjectId = null;
private Boolean isSuccess = false;
private List<DatabaseErrorWrapper> errorWrapperList = new List<DatabaseErrorWrapper>();
/**
* AtomicDML
*/
public class AtomicDML
implements IAtomicDmlWorkUnitGettable
{
public void dmlInsert(List<SObject> objList)
{
List<Database.SaveResult> resultList = database.insert( objList, false );
public interface IAtomicDmlWorkUnitGettable
extends fflib_SObjectUnitOfWork.IDML
{
List<AtomicDmlWorkUnit> getWorkUnitList();
}