Skip to content

Instantly share code, notes, and snippets.

View jongpie's full-sized avatar
☁️

Jonathan Gillespie jongpie

☁️
View GitHub Profile
@infocynic
infocynic / SalesforceIntegrationLicenseHOWTO.md
Last active May 15, 2024 14:36
How to use Salesforce Integration User Licenses

How to make an integration user using the new licenses that became available in April 2023:

If you want to just do it the "easy" way and have the minimum number of PSets, completely bespoke for this integration:

  1. Make a user with the Minimum Access - API Only Integration Profile.
  2. Create a new Permission set that has the "Salesforce API Integration" license. There is a very similarly named license that will not work. Be sure you are using this one. Add all the permissions you need in this pset.
  3. If you are working with packages like Salesforce CPQ, you may need to make additional PSets that have Permission Set Licenses. Those permission sets cannot apply App or System Permissions. **You cannot use any Permission Set that requires a different User License, such as "Salesforce."
  4. Assign this/these Pset(s) to the user
  5. Assign the Integration PSL to that user
@surajp
surajp / traceFlag.sh
Created October 13, 2022 14:53
Add debug logs for a user
#!/usr/bin/env bash
set -euo pipefail
usage="./traceFlag.sh <traced user name>(defaults to 'System') <trace interval in minutes>(defaults to 30 minutes)"
if [[ "$1" = "-h" ]]; then
echo $usage
exit 0
fi
tracedUserName=${1:-System}
traceInterval=${2:-30}
echo "tracing $tracedUserName for $traceInterval minutes"
@surajp
surajp / sf_standard_schema.txt
Created January 28, 2021 00:09
Salesforce Standard Objects and Fields
AboutMe User
AboutMe UserChangeEvent
AcceptLanguage CredentialStuffingEvent
AcceptLanguage CredentialStuffingEventStore
AcceptanceLabel Recommendation
AcceptanceLabel RecommendationChangeEvent
AccessCode ConferenceNumber
AccessLevel AccountBrandShare
AccessLevel AssessmentIndicatorDefinitionShare
AccessLevel AssessmentTaskDefinitionShare
@gdoenlen
gdoenlen / AccountSelector.cls
Last active October 19, 2023 11:42
Simple dependency injection within SFDC
/**
* Selector for the `Account` entity
*/
public class AccountSelector {
public static final AccountSelector INSTANCE = new AccountSelector();
/**
* Finds all accounts that are child accounts of
* the given opportunity's account.
@afawcett
afawcett / CustomPermissionsReader.cls
Last active July 10, 2020 02:04
CustomPermissionsReader
/**
* Copyright (c), 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,
@torsten
torsten / fix-whitespace.sh
Created September 12, 2012 13:58
Pre-commit hook script for git to fix whitespace and long lines.
#!/bin/sh
# Pre-commit hook for git which removes trailing whitespace, converts tabs to spaces, and enforces a max line length.
if git-rev-parse --verify HEAD >/dev/null 2>&1 ; then
against=HEAD
else
# Initial commit: diff against an empty tree object
against=4b825dc642cb6eb9a060e54bf8d69288fbee4904
fi