Skip to content

Instantly share code, notes, and snippets.

View Szandor72's full-sized avatar

Christian Szandor Knapp Szandor72

View GitHub Profile
String xml2json(String xml) {
XmlStreamReader reader = new XmlStreamReader(xml);
reader.setCoalescing(true);
//skip START_DOCUMENT
reader.nextTag();
JsonGenerator g = Json.createGenerator(true);
g.writeStartObject();
@Szandor72
Szandor72 / lts-unit-test.MD
Created April 20, 2018 06:56 — forked from sjurgis/lts-unit-test.MD
How to do actual unit testing in Lightning Testing Service

Expose helper via an public aura:method function in your abstract component's testHelperController.js:

getHelper: function(component, event, helper) {
 if ( $T ) {
  return helper;
 } else {
  throw new Error('API is only supported in test context');
 }
}
@Szandor72
Szandor72 / findDupes
Created October 25, 2017 14:37 — forked from goravseth/findDupes
invocable apex to find duplicate contacts using the new findDuplicates apex stuff
public class Flow_FindDupes {
//https://developer.salesforce.com/forums/?id=906F0000000AzDeIAK
@InvocableMethod(label='Get Dupes' description='Returns something')
public static List<Contact> getDuplicateContacts(List<Contact> contacts) {
system.debug('contacts size = ' + contacts.size());
list<sObject> dasContacts = new list<sobject>();
dasContacts.addall((List<sObject>)(contacts));
list<Contact> duplicateContacts = new list<Contact>();
@Szandor72
Szandor72 / README.md
Created August 10, 2017 11:54 — forked from mattandneil/build.xml
Salesforce Organization Destroy - Ant Script

Salesforce Organization Destroy - Ant Script

This script searches and destroys (most) metadata in an organization. Use cases include ISV package development and testing within Developer Edition and Sandbox environments.

Usage: (paste the macrodef XML into your build file)

<target name="destroy">
    <destroy
 username="${sf.username}"