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
< script type = "text/javascript" > | |
(function($) { | |
$(function() { | |
$('a[href^="http"]:not([href*="' + document.domain + '"])').click(function(e) { | |
// When a user clicks an external link | |
if ($(this).attr('target') !== '_blank') { | |
e.preventDefault(); |
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
<script type="text/javascript"> | |
// from http://briancray.com/ | |
(function (tos) { | |
window.setInterval(function () { | |
// Every 10,000 milliseconds, calculate the time | |
tos = (function (t) { | |
return t[0] == 50 ? (parseInt(t[1]) + 1) + ':00' : (t[1] || '0') + ':' + (parseInt(t[0]) + 10); |
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
<div class="body pricetag" > | |
<header class="title"> | |
<ul id="brand"> | |
<li class="vendor italo"><img src=""></li> | |
<li class="vendor co-host"><img src="{PBSI__PBSI_Item__c3.Vendor_Logo_URL__c.0}"></li> | |
<li><h1 contenteditable="true" data-pricetag-tile="{PBSI__PBSI_Item__c3.Collection__c.0}"><span class="collection lower">{PBSI__PBSI_Item__c3.Collection__c.0} Collection</span></h1></li> | |
</ul> |
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
<div id="message"> | |
<p>Hello staff - the top seller yesterday was {{data.query2.FullName}} with ${{data.query1.amount}} - <em>well done!</em></p> | |
<p>The Best Sale was:</p> | |
<ul> | |
{{#each data.query3}} | |
{{Item_Name__c}}: {{Total_Unit_Quantity_Needed__c}} {{Default_Unit_Name__c}} (${{PBSI__Total_Price__c}}) | |
{{/each}} | |
</ul> | |
</div> |
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
// Load JS from external source | |
<script src="//cdnjs.cloudflare.com/ajax/libs/jquery/2.0.3/jquery.min.js" type="text/javascript"></script> | |
// Add inline JS | |
<script type="text/javascript"> | |
$('#message').append("Message generated on " + Date.now()); | |
</script> | |
// Loads Handlebars library since the message content is using Handlebars templates | |
<script src="//cdnjs.cloudflare.com/ajax/libs/handlebars.js/2.0.0-alpha.1/handlebars.min.js" type="text/javascript"></script> |
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
/* SOQL #1 */ | |
SELECT CreatedById, MAX(Final_Order_Total__c)'amount' FROM PBSI__PBSI__Sales_Order__c WHERE CreatedDate = YESTERDAY; | |
/* SOQL #2 */ | |
/* A query can require data from a previous query */ | |
SELECT FullName FROM User WHERE Id = {{query1.[0].CreatedById}} | |
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
{!REQUIRESCRIPT("/soap/ajax/13.0/connection.js")} | |
var q1 = sforce.connection.query("SELECT Id, Name, PBSI__Item__r.Id, PBSI__Total_Quantity__c FROM PBSI__Lot__c where PBSI__Item__r.Name ='" + item + "' AND PBSI__Total_Quantity__c > 0.1"); | |
var lots = q1.getArray("records"); | |
var inserts = [] | |
for (var i=0; i<lots.length; i++) { | |
var newLine = new sforce.SObject("PBSI__Count_Line__c"); | |
newLine.PBSI__Count_Journal__c = '{!PBSI__Count_Journal__c.Id}'; | |
newLine.PBSI__Item__c = lots[i].PBSI__Item__r.Id; |
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
/* | |
Above is how you comment-out code | |
AND(For_Special_Order__c = TRUE, ISCHANGED(PBSI__Sales_Order_Line__c ), OR(PBSI__Sales_Order__r.Sales_Order_Status__c <> "CANCELLED"),PBSI__Sales_Order__r.Sales_Order_Status__c <> "RESERVED") | |
Below is how you end a comment | |
*/ |
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
<link rel="import" href="../paper-button/paper-button.html"> | |
<link rel="import" href="../paper-calculator/paper-calculator.html"> | |
<link rel="import" href="../topeka-elements/avatars.html"> | |
<link rel="import" href="../core-icon/core-icon.html"> | |
<polymer-element name="my-element"> | |
<template> | |
<style> | |
:host { |
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
var setup = { | |
// Add your keys | |
consumerKey: "XXXXXXXXXXXXXXXXXXXXXXXXXXXX", | |
consumerSecret: "XXXXXXXXXXXXXX" | |
}; | |
function onOpen(e) { | |
var menu = SpreadsheetApp.getUi().createAddonMenu(); | |
menu.addItem('Login to SF', 'menuAuth'); | |
menu.addItem('Update all reports', 'updateTrigger'); |
OlderNewer