Skip to content

Instantly share code, notes, and snippets.

View dashughe's full-sized avatar

Daniel S. Hughes dashughe

  • Advance Local Media, LLC
  • Stone Mountain, GA
View GitHub Profile
@dashughe
dashughe / BatchApexAccountUpdate.cls
Created September 27, 2018 21:29 — forked from dirajkumar/BatchApexAccountUpdate.cls
Apex Snippet: Handling Erroneous Records using Batch Apex
global class BatchApexAccountUpdate implements Database.Batchable<SObject>, Database.Stateful{
global Map<Id, String> errorMap {get; set;}
global Map<Id, SObject> IdToSObjectMap {get; set;}
global BatchApexAccountUpdate(){
errorMap = new Map<Id, String>();
IdToSObjectMap = new Map<Id, SObject>();
}
global Database.QueryLocator start(Database.BatchableContext BC) {
@dashughe
dashughe / SandboxPostCopyUpd.cls
Created September 23, 2018 19:52 — forked from az-ak/SandboxPostCopyUpd.cls
Apex SandboxPostCopy example
global without sharing class SandboxPostCopyUpd implements SandboxPostCopy {
global void runApexClass(SandboxContext context) {
LIst<Contact> ConList = [SELECT ID FROM CONTACT];
for (Contact con : ConList) {
con.Email = 'dummy@example.com';
}
update ConList;
}
}
@dashughe
dashughe / build.xml
Last active July 2, 2018 16:50
Salesforce Organization Destroy - Ant Script
<macrodef name="destroy" description="Destroys all metadata in an organization - Revision 21">
<attribute name="username" />
<attribute name="password" />
<attribute name="serverurl" default="https://test.salesforce.com" />
<attribute name="tempDir" default="temp/destroy" description="Directory to write metadata." />
<attribute name="apiVersion" default="43.0" />
<sequential>
@dashughe
dashughe / soapSforceCom200608Apex.cls
Created May 23, 2018 15:08 — forked from FishOfPrey/soapSforceCom200608Apex.cls
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'};
<tr><td><a name="000">000</a></td><td>Empty Key <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></tr>
<tr><td><a name="002">002</a></td><td>Note <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></tr>
<tr><td><a name="005">005</a></td><td>User</td></tr>
<tr><td><a name="006">006</a></td><td>Opportunity</td></tr>
<tr><td><a name="007">007</a></td><td>Activity</td></tr>
<tr><td><a name="008">008</a></td><td>OpportunityHistory</td></tr>
<tr><td><a name="00A">00A</a></td><td>FORECAST_ITEM</td></tr>
<tr><td><a name="00B">00B</a></td><td>ListView</td></tr>