Skip to content

Instantly share code, notes, and snippets.

View sfboss's full-sized avatar

SFDCBoss sfboss

View GitHub Profile
@sfboss
sfboss / test.notes
Created January 31, 2023 04:26
safd
‎‎​
public class Pokemon {
public Integer count;
public String next;
public String previous;
public List<Results> results;
public class Results {
public String name;
public String url;
}
public static Pokemon parse(String json) {
@sfboss
sfboss / Pokemon.cls
Created December 30, 2022 10:37
Pokemon API Deserializer
public class Pokemon {
public Integer count;
public String next;
public String previous;
public List<Results> results;
public class Results {
public String name;
public String url;
}
public static Pokemon parse(String json) {
global class ReportPickListValues extends VisualEditor.DynamicPickList{
global override VisualEditor.DataRow getDefaultValue(){
VisualEditor.DataRow defaultValue = new VisualEditor.DataRow('select report','select report');
return defaultValue;
}
global override VisualEditor.DynamicPickListRows getValues() {
Report[] theReports = [SELECT Name From Report];
@sfboss
sfboss / AnalyticsUtils.cls
Last active December 16, 2022 06:41
reportComponent
/**
* @description : used for interfacing with the Reports API and Report class to get information from reports to display in a lightning component
* currently used with our Account Lightning Detail page to get bid history information displayable on the Account
* USED WITH PERMISSION FROM LICENSE IN REPO FOR 2015 VERSION
* @author : clay b
* @group : reports
* @last modified on : 11-07-2021
* @last modified by : sfdc cb
* Modifications Log
* Ver Date Author Modification
@sfboss
sfboss / sparklines.field-meta.xml
Created November 19, 2022 04:51
The formula field referencing our custom metadata
IMAGE("https://quickchart.io/chart?c={type:'sparkline',data:{datasets:[{data:["& TEXT($CustomMetadata.Sparklnes__mdt.SparklinesObject.Month1Volume__c)&","&TEXT($CustomMetadata.Sparklnes__mdt.SparklinesObject.Month2Volume__c)&","&TEXT($CustomMetadata.Sparklnes__mdt.SparklinesObject.Month3Volume__c)&","&TEXT($CustomMetadata.Sparklnes__mdt.SparklinesObject.Month4Volume__c)&","&TEXT($CustomMetadata.Sparklnes__mdt.SparklinesObject.Month5Volume__c)&","&TEXT($CustomMetadata.Sparklnes__mdt.SparklinesObject.Month6Volume__c) &","&TEXT($CustomMetadata.Sparklnes__mdt.SparklinesObject.Month7Volume__c)&","&TEXT($CustomMetadata.Sparklnes__mdt.SparklinesObject.Month8Volume__c)&","& TEXT($CustomMetadata.Sparklnes__mdt.SparklinesObject.Month9Volume__c)&","&TEXT($CustomMetadata.Sparklnes__mdt.SparklinesObject.Month10Volume__c)&","& TEXT($CustomMetadata.Sparklnes__mdt.SparklinesObject.Month11Volume__c)&","&TEXT($CustomMetadata.Sparklnes__mdt.SparklinesObject.Month12Volume__c)&","& "]}]}}","")
@sfboss
sfboss / seoBoss_API_WordpressService
Created November 18, 2022 19:29
A method collection for Wordpress REST API calls via Salesforce
public with sharing class seoBoss_API_WordpressService{
public static String username = 'replace_with_username';
public static String password = 'replace_with_password';
public static Blob headerValue = Blob.valueOf(username + ':' + password);
public static String authorizationHeader = 'Basic ' + EncodingUtil.base64Encode(headerValue);
public static Map<String, String> headers = new Map<String, String>{ 'Authorization' => authorizationHeader };
public static String theSiteURL = 'https://sfdcboss.com/index.php/wp-json/wp/v2/';
public static String saveMediaInLibrary(String imageURL, String keyword){
String theExtension = imageURL.right(3);
@sfboss
sfboss / GoogleAPI_PageSpeedInsights_resp
Created November 18, 2022 17:40
Wrapper for pagespeed data
//
//Generated by AdminBooster
//
public class GoogleAPI_PageSpeedInsights_resp{
@AuraEnabled public String analysisUTCTimestamp;
@AuraEnabled public String captchaResult;
@sfboss
sfboss / GoogleAPIService.cls
Created November 18, 2022 17:39
apex to accompany the google page speed lwc
public with sharing class GoogleAPIService {
@AuraEnabled
public static String sendPayloadToApex(String theData) {
GoogleAPI_PageSpeedInsights_resp res = GoogleAPI_PageSpeedInsights_resp.parse(
theData
);
return JSON.serialize(res);
}
@sfboss
sfboss / googlePageSpeedLWC
Created November 18, 2022 17:36
LWC that pulls google page speed stats
import { LightningElement, api, track } from 'lwc';
import parseMetaDetails from '@salesforce/apex/seoBoss_API_HTTPUtils.parseMetaDetails';
//c/avonniBlockquoteimport doGoogleSearchConsoleCallout from '@salesforce/apex/GoogleAPIService.doGoogleSearchConsoleCallout';
//import doLegacyGoogleSearchConsoleCallout from '@salesforce/apex/GoogleAPI_SearchConsole.getSiteData';
import sendPayloadToApex from '@salesforce/apex/GoogleAPIService.sendPayloadToApex';
export default class SeoBoss_siteInfo extends LightningElement {
@api theMetaDetails = '';
@api theTitle = '';
@api theDescription = '';