Mavensmate for Atom: Connecting MavensMate to an existing (non-MavensMate) project

I recently downloaded MavensMate for the Atom text editor, since it supports development of Lightning Component bundles so that I can get them into source control.  After downloading these tools though, I’ve seen some issues when you have an existing project locally (non-MavensMate), but you want to create a MavensMate Project from that repository.  In Mavensmate […]

Custom Logout Button on Lightning Component in Community

If you want to create your own logout button for a Community Lightning Component, you can use the window.location.replace() javascript function. The button component (note: this example is the button only, you would typically include this in a Notification): <aura:component implements=”forceCommunity:availableForAllPageTypes” access=”global”> <ui:button label=”Logout” press=”{!c.logout}”/> </aura:component> And in your controller, you can redirect the user […]

TIL About Using Apex Controllers With Lightning Components

More importantly… I learned how to initialize Lightning Components from properties in an Apex Controller. My scenario: I wanted to display the detail page for a Contact in a lightning component.  Essentially the equivalent of “<apex:detail>” tag.  In Lightning, you can achieve this by using the “<force:recordView>” tag instead.  What I learned is that the […]

TIL about @AuraEnabled

When you’re using an <aura:attribute> that is an instance of a custom Apex Class, you need to use the following approach: Any methods in your class that you want to access from client-side logic must be declared as Static the @AuraEnabled annotation must be used on those methods as well Any properties of the class […]


So I’ve decided to start adding a new type of blog post to this site in an effort to stay more consistently engaged with it (I’ve been slacking and not paying as much attention to it as I would like). I’m going to start posting Today I Learned (#TIL) posts in addition to the regular […]

Visualforce Signature Component with HTML5 Canvas

I’ve come across the scenario a number of times where a client would like to have the ability to capture someone’s signature and keep it on a record in Salesforce.  This post describes a simple way to capture signatures in Salesforce using Visualforce, HTML5 Canvas, and Javascript Remoting. First, we start with a visualforce component […]

Add a Spinner on a Visualforce Page

Here’s a quick and easy way to add a spinner to a Visualforce page for when a user invokes an asynchronous action on a page and is waiting for an element to rerender. Add the following snippet to your visualforce page: <apex:actionStatus id=”pageStatus”> <apex:facet name=”start”> <apex:outputPanel > <img src=”/img/loading32.gif” width=”25″ height=”25″ /> <apex:outputLabel value=”Loading…”/> </apex:outputPanel> […]

Get a Field Label in a Visualforce Page

You can access the Label attribute of a field directly from a Visualforce page by using the following: <apex:outputLabel value=”{!$ObjectType.Account.fields.Name.label}” /> This gets the label for the “Name” field from the “Account” object.  You can interchange any sObject name and it’s corresponding field as needed.