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 […]

#TIL

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 […]