This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module Restforce | |
class Mash < Hashie::Mash | |
class << self | |
def klass(val) | |
if val.key? 'records' | |
# When the hash has a records key, it should be considered a collection | |
# of sobject records. | |
Restforce::Collection |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
begin | |
require 'sinatra' | |
require 'omniauth' | |
require 'omniauth-salesforce' | |
rescue LoadError | |
require 'rubygems' | |
require 'sinatra' | |
require 'omniauth' | |
require 'omniauth-salesforce' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const jsforce = require('jsforce'); | |
const jwt = require("salesforce-jwt-bearer-token-flow"); | |
// create the connection to the org | |
let conn = new jsforce.Connection(); | |
// load the private key for the token | |
let privateKey = require('fs').readFileSync('./server.key', 'utf8'); | |
jwt.getToken({ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function openModal(name) { | |
$("#"+name).addClass('slds-fade-in-open'); | |
$("#backdrop").addClass('slds-backdrop_open'); | |
} | |
function closeModal(name) { | |
$("#"+name).removeClass('slds-fade-in-open'); | |
$("#backdrop").removeClass('slds-backdrop_open'); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="UTF-8"?> | |
<CustomObject xmlns="http://soap.sforce.com/2006/04/metadata"> | |
<actionOverrides> | |
<actionName>Accept</actionName> | |
<type>Default</type> | |
</actionOverrides> | |
<actionOverrides> | |
<actionName>CancelEdit</actionName> | |
<type>Default</type> | |
</actionOverrides> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// create the association object with the final data | |
associations = { | |
"elements": elements | |
} | |
// create all of the associations | |
request({ | |
url: 'https://api.clover.com:443/v3/merchants/'+process.env.CLOVER_MERCHANT_ID+'/category_items', | |
method: 'POST', | |
headers: { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
List<Product2> products = [select id, name from product2 where productcode = 'foo']; | |
Set<Id> ids = (new Map<Id,Product2>(products)).keySet(); | |
System.debug(ids.size()); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[ | |
{ | |
"name": "Insuron Bulk Company" | |
}, | |
{ | |
"name": "Orboid Bulk Company" | |
}, | |
{ | |
"name": "Bovis Bulk Company" | |
}, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This simple controller (without CRUD and FLS) ... | |
public with sharing class AccountController { | |
@AuraEnabled | |
public static List<Account> findAll() { | |
return [SELECT id, name, Location__Latitude__s, Location__Longitude__s | |
FROM Account | |
WHERE Location__Latitude__s != NULL AND Location__Longitude__s != NULL | |
LIMIT 50]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<aura:component > | |
<aura:attribute name="DayOfTheWeek" type="String"/> | |
<aura:if isTrue="{!v.DayOfTheWeek == 'Monday'}"> | |
Today is Monday | |
</aura:if> | |
<aura:if isTrue="{!v.DayOfTheWeek == 'Tuesday'}"> | |
Today is Tuesday | |
</aura:if> | |
<aura:if isTrue="{!v.DayOfTheWeek == 'Wednesday'}"> | |
Today is Wednesday |