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

Salesforce: JavaScript Remoting and Managed Packages

I love the crap out of JavaScript Remoting, but came across a small bug when wrapping up the code in a managed package. As many of you know when you create a managed package it prepends your code with a unique name to prevent code conflicting e.g. a page controller called “MyController” becomes “MyPackage.MyController” where “MyPackage” is the prefix you’ve chosen for your managed package. The bug I’ve found is caused by the fact that the prefix isn’t applied to the JavaScript that calls your Apex Remoting methods i.e you might have an Apex method called “myMethod” which is called like so outside of a managed package environment: [code language=”javascript”] MyController.myMethod(parameters, function(result, event) { callback(result); }, {escape: false}); [/code] Once you package up your code however this call will no longer work, and if you look in the debugging console of your browser you’ll find an error something like: “MyController …

Read more

Salesforce: JavaScript Remoting – a different way of thinking

  JavaScript Remoting for Apex operates in a very different paradigm from what you might be used to i.e. Visualforce pages have controllers and the two interact through action methods – where this might be a full form submission or some neat AJAX functionality. Remoting also calls controller methods but there is a gaping maw in terms of how the two work under the hood. I’ve seen a few great articles on the syntax and example usage of JavaScript Remoting for Apex but when I started using it I came across a number domain differences that weren’t documented anywhere. Hopefully my list here will help you in the learning process. The best way to describe the new way of thinking is to examine the features set in contrast to “normal” Apex and Visualforce. How JavaScript Remoting Differs Pass parameters naturally i.e. the call matches the method signature syntactically instead of …

Read more