Skip to content

Instantly share code, notes, and snippets.

Andrew Fawcett afawcett

Block or report user

Report or block afawcett

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@afawcett
afawcett / XAVWebServices.wsdl
Created Nov 5, 2012
Apex Friendly Version of UPS XAV Service
View XAVWebServices.wsdl
<?xml version="1.0" encoding="UTF-8"?>
<!-- UPS XAV Service WSDL Release Date Dec 29, 2007 -->
<!-- Copyright 2007-2008 United Parcel Service of America, Inc. All rights reserved. -->
<wsdl:definitions xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:error="http://www.ups.com/XMLSchema/XOLTWS/Error/v1.1" xmlns:upss="http://www.ups.com/XMLSchema/XOLTWS/UPSS/v1.0" xmlns:xav="http://www.ups.com/XMLSchema/XOLTWS/xav/v1.0" xmlns:tns="http://www.ups.com/WSDL/XOLTWS/XAV/v1.0" targetNamespace="http://www.ups.com/WSDL/XOLTWS/XAV/v1.0">
<wsdl:types>
<!-- This schema defines the UPS Security header used for authorization purposes -->
<xsd:schema targetNamespace="http://www.ups.com/XMLSchema/XOLTWS/UPSS/v1.0" xmlns:upss="http://www.ups.com/XMLSchema/XOLTWS/UPSS/v1.0" xmlns:xsd="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified">
<xsd:element name="UPSSecurity">
<xsd:complexType>
@afawcett
afawcett / gist:4112895
Created Nov 19, 2012
Sample Export from SObjectDataLoader
View gist:4112895
{
"RecordSetBundles": [
{
"Records": [
{
"attributes": {
"type": "ObjectA__c",
"url": "/services/data/v26.0/sobjects/ObjectA__c/a00d0000007kUmsAAE"
},
"CreatedDate": "2012-11-19T18:32:50.000+0000",
@afawcett
afawcett / SomeClassA.cls
Created Feb 2, 2013
Sample code used to test a prototype Apex Analysis tool using the new Spring'13 Tooling API.
View SomeClassA.cls
public class SomeClassA
{
public static void someMethod()
{
SomeClassB.someMethodB();
someOtherMethod();
}
public static void someOtherMethod()
{
View SessionsController.cls
public with sharing class SessionController {
public List<Session__c> lstSessions {get;set;}
public SessionController()
{
lstSessions = [select Id, Session_Status__c, GL_Department__c, Quantity__c, Unit_Cost__c from Session__c];
}
public PageReference createNewSession()
View ValidationController.cls
public with sharing class ValidationController
{
private ApexPages.StandardController standardController;
public ValidationController(ApexPages.StandardController standardController)
{
// Configure fields to query and valid (alternative to SOQL)
this.standardController = standardController;
if(!Test.isRunningTest())
this.standardController.addFields(
View myClass.cls
global class myClass
{
global class wrapperClass
{
public String name {get; set;}
public Account account {get; set;}
public wrapperClass()
{
account = new Account();
@afawcett
afawcett / TestA.cls
Created May 5, 2013
Reproduction of Salesforce code coverage bug.
View TestA.cls
public class TestA {
public TestA()
{
}
public class TestB
{
public Integer doSomething()
{
Integer x = 1;
@afawcett
afawcett / ant-salesforce.xml
Last active Nov 25, 2018
Defines some macros around sf:deploy to install and uninstall packages.
View ant-salesforce.xml
<!-- TODO: Review Ant v1.8 local properties -->
<project xmlns:sf="antlib:com.salesforce">
<!-- Download from Salesforce Tools page under Setup -->
<typedef
uri="antlib:com.salesforce"
resource="com/salesforce/antlib.xml"
classpath="${basedir}/lib/ant-salesforce.jar"/>
<!-- Download from http://sourceforge.net/projects/ant-contrib/files/ant-contrib/1.0b3/ -->
@afawcett
afawcett / BatchWorker.cls
Last active Apr 30, 2019
Sample code from
View BatchWorker.cls
/**
* Copyright (c) 2013, Andrew Fawcett
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification,
* are permitted provided that the following conditions are met:
*
* - Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* - Redistributions in binary form must reproduce the above copyright notice,
View gist:6791111
public with sharing class AssertCallback {
private static Map<Type, IAssertCallback> callbacks = new Map<Type, IAssertCallback>();
public interface IAssertCallback
{
void assert(String location, Object state);
}
public static void assert(Type stateType, String location, Object state)
You can’t perform that action at this time.