Skip to content

Instantly share code, notes, and snippets.

Avatar

Christian Szandor Knapp Szandor72

View GitHub Profile
View Apex XML2JSON.cls
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 Apr 20, 2018 — forked from sjurgis/lts-unit-test.MD
How to do actual unit testing in Lightning Testing Service
View lts-unit-test.MD

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 Oct 25, 2017 — forked from goravseth/findDupes
invocable apex to find duplicate contacts using the new findDuplicates apex stuff
View findDupes
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 Aug 10, 2017 — forked from mattandneil/build.xml
Salesforce Organization Destroy - Ant Script
View README.md

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}"