Skip to content

Instantly share code, notes, and snippets.

#!/bin/bash
function clean-metadata {
clean-item $1 '/<fieldPermissions>/,/<\/fieldPermissions>/d'
clean-item $1 '/<userPermissions>/,/<\/userPermissions>/d'
clean-item $1 '/<recordTypeVisibilities>/,/<\/recordTypeVisibilities>/d'
clean-item $1 '/<recordTypeVisibilities>/,/<\/recordTypeVisibilities>/d'
clean-item $1 '/<categoryGroupVisibilities>/,/<\/categoryGroupVisibilities>/d'
clean-item $1 '/<applicationVisibilities>/,/<\/applicationVisibilities>/d'
clean-item $1 '/<tabVisibilities>/,/<\/tabVisibilities>/d'
name: sfdx test flow
on: [push]
jobs:
setup:
runs-on: ubuntu-latest
container: salesforce/salesforcedx
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Install NPM modules
@jdgirald
jdgirald / tasks.json
Created September 18, 2020 19:17 — forked from agentgill/tasks.json
{
"version": "2.0.0",
"tasks": [
{
"label": "SFDX: Deploy Current File",
"type": "shell",
"command": "sfdx",
"args": [
"force:source:deploy",
"--sourcepath",
@jdgirald
jdgirald / ajaxify-html4.js
Created June 12, 2020 01:41 — forked from balupton/ajaxify-html4.js
Ajaxify a Website using the HTML4 HashChange Functionality
(function(window,undefined){
// Prepare our Variables
var
document = window.document,
$ = window.jQuery;
// Wait for Document
$(window).bind(function(){
// Prepare Variables
@jdgirald
jdgirald / deployDestructiveChange.sh
Last active May 13, 2020 19:49 — forked from benahm/deployDestructiveChange.sh
Deploy a destructive change using the Salesforce CLI
#!/bin/sh
#
# author : benahm
# description : deploy a destructive change
# inputs
TARGET_ENV=$1
SOURCE_PATH=$2
# constants
@jdgirald
jdgirald / AsyncReportController.cls
Created March 6, 2020 20:42 — forked from peterknolle/AsyncReportController.cls
Asynchronous Reports with the Analytics API in Apex
public with sharing class AsyncReportController {
public List<SelectOption> availableReports { get; set; }
public Id reportId { get; set; }
public Id instanceId { get; set; }
public Boolean reportIsRunning { get; set; }
private transient Reports.ReportResults reportResults;
public AsyncReportController() {
availableReports = retrieveAvailableReports();
//Generated by wsdl2apex
//Modified by Ankit Sharma
public class MetadataService {
public class RemoteSiteSetting extends Metadata {
public String type = 'RemoteSiteSetting';
public String fullName;
public String description;
public Boolean disableProtocolSecurity;
/**
* Sleep at least a second
*
* Found at: http://boards.developerforce.com/t5/Apex-Code-Development/Best-way-to-delay-until-time-changes-in-a-test/td-p/389619
*
*/
public static void waitAtLeastASecond() {
Integer msPerS = 1000;
Datetime start = Datetime.now();
Datetime current = Datetime.now();
@jdgirald
jdgirald / README.md
Created May 31, 2019 22:24
Connected Apps TIL

Here's a few things we learned working with OAuth and Connected Apps.

What are Connected Apps?

Connected Apps allow non-Salesforce apps to do stuff on behalf of a Salesforce user. For example:

  • Send your user information to another system with a single click.
  • Allow another system to send information into your Salesforce API.

Typically they authorize how to "borrow" a Session ID under tight controls.

@jdgirald
jdgirald / package.xml
Created May 30, 2019 21:46
Salesforce Standard Value Sets
<Package xmlns="http://soap.sforce.com/2006/04/metadata">
<version>39.0</version>
<types>
<name>StandardValueSet</name>
<members>AccountContactMultiRoles</members>
<members>AccountContactRole</members>
<members>AccountOwnership</members>
<members>AccountRating</members>
<members>AccountType</members>
<members>AddressCountryCode</members>