Salesforce Analytics API Sample Code

A picture is worth a thousand words, so goes the justification for graphic novels. I kid, I love the hell out of graphic novels but now I’ve been sidetracked and this is only the second sentence of this post. So, the Analytics API. I’m pretty enamoured with it as it seems is Pat Patterson, and I think that it’s one of the most useful features the platform has ever made available. Presenting the right chart (or set of charts) to a manager or executive can empower them to make business decision in minutes, powerful stuff. To that end myself and a few of my fellow Tquilites have begun building an opensource library of Analytics API demos to aid you in aiding your clients/managers/execs. Below I’ve included a few introductory steps to help you get started. To start with you’ll need the code from github. Step 0 I’ll be stepping through …

Read more

Developing Chrome Extensions for Salesforce

Chrome extensions are awesome, they provide amazing convenience that is limited only by your imagination. There are some amazing Chrome Extensions for Salesforce already, some of my favourites being: As a great fan of JavaScript I’ve always wanted to create a Chrome Extension for Salesforce and I’ve finally gotten around to it. The hardest part was figuring out what context the JS executes in (e.g. in the current tabs context, or in some separate context). Let me step through the code to show you how it’s done. Chrome Extension Structure A Chrome Extension is made up of a JavaScript, HTML, images and JSON. At its core is a manifest file which contains the metadata describing your application in JSON. There is a lot of documentation about the structure of this file but some of the key elements are shown below. This file references all external resources (JavaScript, images etc.), the …

Read more

Salesforce: Files vs CRM Content vs Knowledge vs Documents vs Attachments

Choosing the right file or document management system on- (or off-) platform can be a difficult decision, and one of those things that’s difficult to change once implemented so it’s important to make the right choice up front. Salesforce.com has a number of content and document solutions (and more on the way) and the options when given a set of decision points aren’t always clear. To this end I’ve created a matrix comparing the on-platform systems which should make that decision easier. It’s based on the official documentation but add in a few other key decision points (please don’t sue me Salesforce, I’m just a lowly a certified technical architect!). If I’ve got anything wrong, or left something out please let me know.

Salesforce User License Feature Matrix

Understanding Salesforce licensing is incredibly important for all areas of a business buying salesforce and implementation projects. Common questions are: What licenses are available? How much do they cost? Which license types support my intended solution? What are the limitations? How are they “consumed”? As part of my Salesforce TA Certification I created a matrix that compares all current license types making it easy to learn about licenses and make the licensing decision a bit easier. The matrix isn’t comprehensive but instead tries to balance ease-of-use whilst providing the most important decision points. Let me know if I missed anything important! References User license types Getting started with communities

Salesforce Certified Technical Architect

Fall seven times, stand up eight. – Japanese proverb Finally, I have this certification. This has been a journey for me, and taken much longer than I anticipated. I did fail the first attempt, but was given a retry (make-up exam) in the sections that I’d failed. I subsequently failed that too. My second, full attempt saw me pass, and in fact I found it quite easy so let me help you learn from my mistakes. Attempt 1 Late last year I booked in my board review exam. I’m not going to go into the detail of what the board exam entails it’s because this has been discussed in detail here, here and here. I spent a lot of time preparing, and had some ad hoc coaching from the UK SFDC certification team but in the end the hypothetical exam destroyed me. Here’s why: I’d been developing apps for nearly a …

Read more

Salesforce: Sharing Cheat Sheet

Sharing is complex, but necessarily so. It gives you incredibly fine-grained control over data access through it’s flexibility but requires quite a deep understanding to do it properly. There are great articles out there that describe sharing in detail e.g. Force.com object and record level security An Overview of Force.com Security I don’t want to recreate what’s in those articles, instead I’m providing a short, sharp cheat sheet of the major topics you need to understand. So without further ado… Sharing Cheat Sheet Sharing Metadata Records Implicit Sharing Organisation-Wide Defaults (OWD) No Relationship Master Detail Lookup Manual Sharing Apex Managed Sharing Recalculation Choosing the Right Share Type “Traditional” / Ownership-based Sharing Rules Criteria-based Sharing Rules Apex Managed Sharing Rules Manual Sharing Rules Share Groups Sharing Sets Portals High Volume Portals (Service Cloud Portals) other portals Large Data Volumes If you’ve got any other items you think should be in this …

Read more

Salesforce: Insufficient privileges when trying to access Activity Settings

This strange issue blocked access to certain areas of the setup menu in my production Org, and I couldn’t find a comprehensive solution so here we are. The problem is documented most comprehensively here with problem statement as: If you choose to show a custom logo in meeting requests, if the admin who specifies the logo specifies a document that other admins cannot access, then other admins will be locked out of the entire activity settings page. If the file was created in the last six months you can find out which fart-face did this and have a quick chat with them. However, if the change was made more than 6 months ago you’re in a bit of a sticky situation. The advice of the aforementioned document is to contact salesforce.com support and ask them to let you know who owns the file. However, you can do this yourself using …

Read more

Salesforce JavaScript Remoting: Using Apex and JavaScript objects to pass data from client- to server-side and vice versa

I’ve spoken about how to do this at a high level during Cloudstock London and there are hints at how it can be done but no formal documentation that I’ve found, so here we are 🙂 Quite simply JavaScript Remoting will transform Apex objects and classes (or collections of these types) into JavaScript objects for you. The opposite is true too but there are some rules you need to observe. Apex Types to JavaScript Equivalents This is the easier of type conversions in that you don’t have to really do anything to make it happen. The code below uses a custom class that I’ve defined but you can do the same with any sObject too. Let’s have a look at the code. The Controller The Visualforce The Output JavaScript Types to Apex Equivalents This is a little tricker, especially when it comes to sObjects. Note that the approach below works for …

Read more

Using the Heroku Shared Database with Sinatra and Active Record

ActiveRecord is an amazing (mostly) database-agnostic ORM framework and so it’s a natural choice to use with non-Rails frameworks such as Sinatra. Note that I’ll be using sqlite3 locally but the Heroku Shared Database is a Postgres database so I’ll be setting my environments appropriately. In this post I’ve assumed that you have a Sinatra app that is working locally and on Heroku. Getting it working locally First up you’ll need a few extra gems in your Gemfile, once again note that I’m using different databases in development, test and production environments. [code language=”ruby”] source ‘http://rubygems.org’ gem ‘sinatra’ gem ‘activerecord’ gem ‘sinatra-activerecord’ # excellent gem that ports ActiveRecord for Sinatra group :development, :test do gem ‘sqlite3’ end group :production do gem ‘pg’ # this gem is required to use postgres on Heroku end [/code] Don’t forget that you’ll need to install the gems using bundler. [code language=”bash”] bundle install [/code] And …

Read more

Voodoo – A Todo list that demos the power of KnockoutJS

This small demo app will demonstrate the usage and power of JavaScript MVC frameworks and in particular KnockoutJS. You can learn more about the framework through the tutorials on the KO site. I will gloss over some of the details but you can learn more in framework documentation. My goal here is to give you a high-level sense of what’s possible. The picture along side shows what we’re building. You can find the demo here and the full sourcecode here. The HTML Strictly speaking jQuery is not required for KO to work but it is likely that you will often include it as a helper for the framework. As alway you need to start with the static resource inclusions. [code language=”html”] <script type="text/javascript" src="js/jquery-1.7.1.min.js"></script> <script type="text/javascript" src="js/knockout-2.0.0.js"></script> [/code] And you’ll need a form in order to create new todo items. [code language=”html”] <form data-bind="submit: addTask" id="create-todo"> <input class="new-todo" data-bind="value: newTaskText" …

Read more