Skip to content

Instantly share code, notes, and snippets.

View FishOfPrey's full-sized avatar
💭
🦈

Daniel Ballinger FishOfPrey

💭
🦈
View GitHub Profile
<tr><td><a name="000">000</a></td><td>EmptyKey</td><td><a href="http://www.fishofprey.com/2011/06/salesforce-empty-key-id.html">Ref</a></td></tr>
<tr><td><a name="001">001</a></td><td>Account</td><td></td></tr>
<tr><td><a name="002">002</a></td><td>Note</td><td><a href="http://www.salesforce.com/us/developer/docs/api/Content/sforce_api_objects_note.htm">Doc</a></td></tr>
<tr><td><a name="003">003</a></td><td>Contact</td><td></td></tr>
<tr><td><a name="005">005</a></td><td>User</td><td></td></tr>
<tr><td><a name="006">006</a></td><td>Opportunity</td><td></td></tr>
<tr><td><a name="007">007</a></td><td>Activity</td><td></td></tr>
<tr><td><a name="008">008</a></td><td>OpportunityHistory</td><td></td></tr>
<tr><td><a name="00A">00A</a></td><td>FORECAST_ITEM</td><td></td></tr>
<tr><td><a name="00B">00B</a></td><td>ListView</td><td></td></tr>
<tr><td>AccessCMC</td><td>Access Community Management</td></tr>
<tr><td>AccessContentBuilder</td><td>Access drag-and-drop content builder</td></tr>
<tr><td>AccountSwitcherUser</td><td>Account Switcher User</td></tr>
<tr><td>ActivateContract</td><td>Activate Contracts</td></tr>
<tr><td>ActivateOrder</td><td>Activate Orders</td></tr>
<tr><td>ActivitiesAccess</td><td>Access Activities</td></tr>
<tr><td>AddAnalyticsRemoteConnections</td><td>Add Analytics Remote Connections</td></tr>
<tr><td>AddDirectMessageMembers</td><td>Add People to Direct Messages</td></tr>
<tr><td>AddWaveNotificationRecipients</td><td>Notification Emails: Add Recipients</td></tr>
<tr><td>AllowEmailIC</td><td>Email-Based Identity Verification Option</td></tr>
@FishOfPrey
FishOfPrey / Assert.apex
Created October 3, 2023 06:09
System Assert Class shadowing
public class Assert {
public static void areEqual(Object expected, Object actual, string msg) {
System.debug('Assert Shadowing Test');
System.Assert.areEqual(expected, actual, msg);
}
}
@FishOfPrey
FishOfPrey / sObjectComparator.cls
Created August 29, 2023 02:25
An Apex Comparator implementation for sorting by sObject fields.
public class sObjectComparator implements Comparator<sObject> {
// Asc and Desc are reserved keywords in Apex!
public enum SortOrder { Ascend, Descend}
private Schema.sObjectField sortField;
private DescribeFieldResult describeResult;
public SortOrder order {
get;
@FishOfPrey
FishOfPrey / Spring 2020 Found keyprefixes
Last active June 8, 2021 11:44
Short list of new keyprefixes found in Spring '20 release. The complete list is at http://www.fishofprey.com/2011/09/obscure-salesforce-object-key-prefixes.html
02I - InsightsApplication - formerly MH_GOLD_INFORMATION
02H - EltWorkflowJobDetail - formerly MH_GOLD_PROGRAM
02L - DataflowVersion - formerly MH_CUSTOMER_CRITERION
02M - DatasetAccess - formerly MH_GREENSHEET
02O - DatasetRegister - formerly MH_GREEN_GET_INFO
02P - DataflowGroupMember - formerly MH_CONTACT_ROLE
02Q - DataflowGroupDependency - formerly MH_INFORMATION
02W - DataflowGroupTrigger
030 - DataflowRequest - formerly PROFILE_TAB_SET
03L - DataflowNode
@FishOfPrey
FishOfPrey / soapSforceCom200608Apex.cls
Last active January 27, 2021 16:54
Call the Salesforce Apex API executeAnonymous web method and return resulting the DebuggingHeader
//Generated by FuseIT WSDL2Apex (http://www.fuseit.com/Solutions/SFDC-Explorer/Help-WSDL-Parser.aspx)
//Methods Included: executeAnonymous
//Methods Excluded: compileAndTest, compileClasses, compileTriggers, runTests, wsdlToApex
// Primary Port Class Name: Apex
public class soapSforceCom200608Apex {
public class AllowFieldTruncationHeader_element {
public Boolean allowFieldTruncation;
private String[] allowFieldTruncation_type_info = new String[]{'allowFieldTruncation','http://soap.sforce.com/2006/08/apex','boolean','1','1','false'};
private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/08/apex','true','false'};
private String[] field_order_type_info = new String[]{'allowFieldTruncation'};
//Generated by FuseIT WSDL2Apex (http://www.fuseit.com/Solutions/SFDC-Explorer/Help-WSDL-Parser.aspx)
//Methods Included: getActivateResult, testCallback, initAndActivate, init, initAndDuplicate, getSaveResult, initAndSave, getInitResult, getDuplicateResult, activate, save
// Primary Port Class Name: embeddedAsync
public class webserviceEmbeddedServerQaBackendCo {
private static final String s_ns0 = 'http://webservice.embedded.server.qa.backend.com/';
public class ActivateContext_element {
private transient String[] apex_schema_type_info = new String[]{s_ns0,'true','false'};
private transient String[] field_order_type_info = new String[]{};
}
public class ActivateResult_element {
public class BulkInsertProfiler extends LimitsProfiler {
private List<String> fieldsToCheck;
transient Savepoint sp = null;
List<Contact> c;
public BulkInsertProfiler() { }
public override void setup() {
sp = Database.setSavepoint();
public virtual class EinsteinVision_HttpBodyPart {
//...
/**
* Write a key-value pair to the form's body for a blob.
*/
public static string WriteBlobBodyParameter(string key, string file64, string filename, string mimeType) {
string contentDisposition = 'Content-Disposition: form-data; name="' + key + '"; filename="'+filename+'"';
string contentDispositionCrLf = contentDisposition + '\r\n';
@FishOfPrey
FishOfPrey / Baseline.cls
Created November 1, 2019 09:49
Differences between baseline ESAPI insertAsUser and stripping version
public SFDCAccessControlResults.InsertResults insertAsUser(SObject [] devObjs, List<String> fieldsToSet) {
if (devObjs == null || devObjs.size() == 0 || fieldsToSet == null || fieldsToSet.size() == 0)
throw new AccessControlDmlException('null or empty parameter');
Schema.DescribeSObjectResult d = devObjs.getSObjectType().getDescribe();
if (d.isCreateable() == false)
throw new SFDCAccessControlException('Access Violation',
SFDCAccessControlException.ExceptionType.OBJECT_ACCESS_VIOLATION,
SFDCAccessControlException.ExceptionReason.NO_CREATE,
d.getName(),