Skip to content

Instantly share code, notes, and snippets.

@paulroth3d
paulroth3d / gist:44367d8313af69b57ab84e67cb32bce0
Created January 3, 2017 19:00
Custom Setting in JavaScript
<script type='text/javascript'>
var domain='{!$Setup.EnvironmentSettings__c.Domain__c}';
liveagent.details.preChatInit('https://' + domain+'/chat','detailCallBack');
</script>
//-- for more information, please see: https://developer.mozilla.org/en-US/docs/Web/API/MutationObserver
//-- creates the observer that will fire the function when the dom is updated.
//-- in this case when we scroll, there are new elements added to the fixedHeaderContainer
//-- so we just run from that
//-- if we wanted to be smarter, we can look through the mutations arguments to see if
//-- any mutation records (i.e. mutations[0].addedNodes is greater than 0)
var observer = new MutationObserver( function( mutations, observer ){
console.log( "mutations occurred" ); console.log( mutations ); console.log( this );
jq( "#gbMainTable > tbody > tr > td.fixedHeaderContainer tr td[name='v5']" ).hide();
@paulroth3d
paulroth3d / _README.md
Last active August 8, 2017 19:56
GoToMarket Conversation Outline

overview

This page has moved, please reach out to Paul or Zack for an updated URL.

@paulroth3d
paulroth3d / BigO_SecurityConnection
Last active March 8, 2019 05:57
Salesforce Custom Adapter for External Object Row-Level Security
/**
* Example DataSource.Connection class
* that provides row level security
* for Archived BigObject records
*
* For more information, please see:
* https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_connector_start_connection_class.htm
* or
* https://help.salesforce.com/articleView?id=apex_adapter_setup.htm&type=0
*
@paulroth3d
paulroth3d / findDevUsage.sh
Created May 11, 2018 06:23
Find Dev usage
#!/bin/bash
# @TODO: provide more documentation.
# This is a shellscript that works on *nix / mac - but does not work on windows
# because it needs to use grep (and the very important -c --context lines around those matches
# but can be used on windows with a *nix emulator like cygwin
# to run: . findDevUsage.sh "[[ Field API Name to search ]]"
# this will output a file in /tmp/fieldAssignments/fieldAPIName__c_usage.html"
# or
@paulroth3d
paulroth3d / gist:99c7ead780d625ffd28d00efc604db83
Created May 11, 2018 19:30
The following is a simple way to get all field definitions for a single object
....
public with sharing class ExampleController {
@AuraEnabled
public static Map<String,CustomFieldDefinition> getOpportunityDescribes(){
//-- Through deep binding, it is possible to retrieve the field limitations from apex
//-- and leverage within lightning components.
//-- However, it is often recommended to optimize them to a
@paulroth3d
paulroth3d / _README.md
Created June 26, 2018 14:44
Example Component with Spinner

Component that makes a change and then auto-closes

To create a component that would perform an update and then auto close.

(Please note that this is from this installable demo here: https://github.com/SalesforceCloudServices/ltng-support-button-update )

Within this example, we load info from this record and set the value and then close the modal automatically.

  • Preferrably without the end user seeing the modal, but this depends on the speed that javascript is processed on the client.
@paulroth3d
paulroth3d / .gitignore
Last active October 10, 2018 15:26
SFDX metadataRefresh
.DS_Store
@paulroth3d
paulroth3d / __PageHeader - Simple Lightning Component.md
Created October 19, 2018 16:24
Description of a very simple component to provide the Lightning Design System - Page Header

Overview

Really simple component to show a page header in Lightning Experience

Includes the following:

  • Component - the core of the component
    • Includes the attributes (the things that other components can configure on this component through code)
    • handlers (to communicate with the controller)
  • events (that it can listen to from other components it contains)
@paulroth3d
paulroth3d / LightningSafeNavigation.js
Last active April 27, 2022 07:17
Lightning Safe Navigation
/*global sforce console $A window */
/*eslint no-console: "off"*/
/**
* Utility Scripts for common navigation patterns.
**/
this.LightningSafeNavigation = {};
/**