This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/*** | |
Adapted from the great Dan Appleman. | |
For more on this and many other great patterns - buy his book - http://advancedapex.com/ | |
This class can be used to schedule any scheduled job without risk of locking the class. | |
DO NOT CHANGE THIS CLASS! It is locked by the scheduler. Instead make changes to ScheduledHelper or your own IScheduleDispatched class | |
To use: | |
1) Create a new class to handle your job. This class should implement ScheduledDispatcher.IScheduleDispatched | |
2) Create a new instance of ScheduledDispatcher with the type of your new class. | |
3) Schedule the ScheduledDispatcher instead of directly scheduling your new class. | |
See ScheduledRenewalsHandler for a working example. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.example; | |
import org.apache.commons.lang.NullArgumentException; | |
import org.slf4j.Logger; | |
import org.slf4j.LoggerFactory; | |
import java.io.File; | |
import java.io.FileNotFoundException; | |
import java.io.FileReader; | |
import java.io.IOException; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static String buildSoapLogin(String username, String password) { | |
def builder = new StreamingMarkupBuilder() | |
builder.encoding = 'UTF-8' | |
def soapEnv = builder.bind { | |
mkp.xmlDeclaration() | |
mkp.declareNamespace(soapenv: SOAP.SOAP11_NS) | |
mkp.declareNamespace(tns: 'urn:partner.soap.sforce.com') | |
mkp.declareNamespace(ens: 'urn:sobject.partner.soap.sforce.com') | |
'soapenv:Envelope' { | |
'soapenv:Header' { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public with sharing class TasksUpdateSalesActivity { | |
public static final String STATUS_COMPLETED = 'Completed'; | |
@TestVisible | |
private Task[] newLeadContactTasks { | |
get { | |
if (newLeadContactTasks == null) { | |
newLeadContactTasks = new Task[]{}; | |
// process trigger.new and only return tasks associated with a lead or contact |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var j$ = jQuery.noConflict(); | |
if ({! debugEnabled }) { | |
loadSourcesLocalhost().fail(loadSourcesSfdc); | |
} else { | |
loadSourcesSfdc(); | |
} | |
function loadSourcesLocalhost() { | |
return j$.ajax({url: '//localhost:3000/vendor.js', dataType: 'script', timeout: 100}) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
PharmCAS Import Controller - Used by VF Page pharmcasImport | |
This controller mostly offers some RemoteAction methods to our Visualforce page | |
Most of the Remote Actions act as proxies for web service calls to the WebAdMIT system in order to work around CORS restrictions. | |
e.g. initiateExport, checkExportStatus, and downloadExport | |
upsertApps is the main action on this controller. It will receive a list of WebAdMIT records and process them in Salesforce. | |
For more info on this refer to the Technical Documentation at https://docs.google.com/document/d/edit | |
*/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh -e | |
function printHelp() { | |
echo "Incorrect usage. Example:\n\t./soql2csv.sh \"SELECT Id, Name FROM Account LIMIT 10\" myorg > accounts.csv"; | |
} | |
if [ ! -e "`which jq`" ]; then | |
echo "You need to install jq to use this script." | |
if [[ "`uname`" == "Darwin" && -e "`which brew`" ]]; then | |
echo "Try running 'brew install jq'" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#compdef sfdx | |
# SFDX Autocomplete plugin for Oh-My-Zsh | |
# Requires: The SFDX client CLI | |
# Author: gbutt | |
# Usage: add this file to ~/.oh-my-zsh/plugins/sfdx, and then add sfdx to your plugins in ~/.zshrc | |
local -a _1st_arguments | |
_1st_arguments=( | |
"force\:alias\:list":"list username aliases for the Salesforce CLI" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
mkdir tmp | |
# get all record types and save to a file | |
sfdx force:data:soql:query --query "SELECT ID, DeveloperName, SObjectType FROM RecordType WHERE IsActive = true" > tmp/recordtypes.txt | |
# get record type id for account record type with developer name = Educational_Institution | |
RTID_ACCOUNT_INSTITUTION=`cat tmp/recordtypes.txt | awk ' $3 ~ /Account/ && $2 ~ /Educational_Institution/ { print $1 } ' ` |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class TestDataFactory { | |
public class SObjectGenerator { | |
public Integer seed = 0; | |
private Map<String,Object> fields; | |
private SObjectType sobType; | |
public SObjectGenerator(SObjectType sobType, Map<String,Object> fields) { | |
this.fields = fields; | |
} |
OlderNewer