Skip to content

Instantly share code, notes, and snippets.

View sfboss's full-sized avatar

SFDCBoss sfboss

View GitHub Profile
{
"items": [
{
"depth": 1,
"response.headers.": "",
"url": "https://sfdcboss.com/xmlrpc.php",
"response_headers_content-type": "text/plain;charset=UTF-8",
"response_headers_x-bitrix-composite": "",
"response_headers_x-page-speed": "",
"response_headers_x-cached-by": "",
{
"items": [
{
"field157": "",
"field158": "",
"field159": "",
"field160": "",
"url": "https://sfdcboss.com/xmlrpc.php",
"title": "",
"lighthouse_scores_performance": 0,
{
"items": [
{
"url": "https://sfdcboss.com/xmlrpc.php",
"title": "",
"lighthouse_scores_performance": 0,
"lighthouse_scores_pwa": 0,
"lighthouse_scores_accessibility": 0,
"lighthouse_scores_best-practices": 0,
"lighthouse_scores_seo": 0,
@sfboss
sfboss / niavc.sh
Last active October 4, 2022 01:47
latest n greatest
for i in $(cat ./filesOutput/logs/content_docs_ids.txt); do
firstthreechars=${i:0:3}
# poor mans way of checking if the line in our file is a contentdocumentid
if [ $firstthreechars = '069' ];then
echo 'downloading record '$i
# bunch of string parsing and querying to get what we need
thequerycontent="select ContentDocument.owner.name,ContentDocument.owner.id,linkedentityid,contentdocumentid,linkedentity.type,linkedentity.name,contentdocument.title,contentdocument.fileextension,id from contentdocumentlink where linkedentity.name != 'User' AND contentdocumentid = '"${i}"'"
thejson=$(sfdx force:data:soql:query -q "$thequerycontent" -u $1 --json | ./jq-win64.exe '.result.records')
@sfboss
sfboss / niavcContent
Last active September 24, 2022 05:08
LatestforFilesExport
for i in $(cat ./filesOutput/logs/content_docs_ids.txt); do
firstthreechars=${i:0:3}
# poor mans way of checking if the line in our file is a contentdocumentid
if [ $firstthreechars = '069' ];then
echo 'downloading record '$i
# bunch of string parsing and querying to get what we need
thequerycontent="select ContentDocument.owner.name,ContentDocument.owner.id,linkedentityid,contentdocumentid,linkedentity.type,linkedentity.name,contentdocument.title,contentdocument.fileextension,id from contentdocumentlink where contentdocumentid = '"${i}"'"
thejson=$(sfdx force:data:soql:query -q "$thequerycontent" -u $1 --json | ./jq-win64.exe '.result.records')
@sfboss
sfboss / oauth_handler.cls
Created September 7, 2022 01:34
OAuth generic handler to get access token and parse based on key/secret and credentials hardcoded or custom setting'ed
public class RRSign_OAUTH_Handler implements Schedulable, Database.AllowsCallouts {
public void execute(SchedulableContext SC){
run();
}
@future(callout=true)
public static void run(){
String endpoint = 'https://test.salesforce.com/services/oauth2/token';
// or use this endpoint for a sandbox org:
// String endpoint='https://test.salesforce.com/services/oauth2/token';
@sfboss
sfboss / salesforce and pivotal tracker integration
Created September 6, 2022 03:51
JSON payload for Activity Update
[
{
"kind": "iteration_update_activity",
"guid": "123",
"project_version": 66,
"message": "Wilhuff Tarkin changed iter",
"highlight": "changed",
"changes": [
{
"kind": "iteration_override",
@sfboss
sfboss / reddit_po1_2
Last active September 5, 2022 04:38
Power of one example for CASESAFEID use case
<?xml version="1.0" encoding="UTF-8"?>
<CustomField xmlns="http://soap.sforce.com/2006/04/metadata">
<fullName>NO_casesafe_PO1__c</fullName>
<externalId>false</externalId>
<formula>IF($User.Id == User__c,1,0)</formula>
<formulaTreatBlanksAs>BlankAsZero</formulaTreatBlanksAs>
<label>NO casesafe PO1</label>
<precision>18</precision>
<required>false</required>
<scale>0</scale>
public with sharing class bCheckController {
@AuraEnabled
public static Boolean approveDC(Id theDCId){
//Class used for Approving Record
try {
Approval.ProcessWorkitemRequest req = new Approval.ProcessWorkitemRequest();
req.setComments('Approving request for DC');
//Approve or Reject Record
public with sharing class customApprovalsController {
@AuraEnabled
public static List<wrapperClass> getApprovals(String theType, String theCommentFilter){
List<wrapperclass> theApprovals = getPendingList(theType, theCommentFilter);
return theApprovals;
}