Bookmarklet for Lightning Doc App

Posted on Mar 11, 2017

This is a simple javascript bookmarklet that will take you to the Lightning Documentation App from any SF page on your domain.  Works with Lightning or Classic.

javascript:'https://' + window.location.host.split('.')[0] + '.lightning.force.com/auradocs/reference.app#'

To use the link, create a bookmark with that code as the URL, or drag this link to your bookmarks toolbar.

Partial Copy Sandboxes: "Ghost Dad"

Posted on Feb 27, 2017

Salesforce gave us Partial Copy Sandboxes (which I think have been renamed Partial Data Sandboxes) and Sandbox Templates a few releases ago, the former of which is sort've halfway between a Developer Pro sandbox and a Full sandbox, where it doesn't have all your data and can be refreshed more quickly than a full sandbox, and the latter is used to specify the data you want to copy from prod when refreshing a Full or Partial Copy Sandbox.

I wanted to write about some weirdness with Partial Copy Sandboxes.

Partial Copy Sandboxes have some limits, which (as of this posting) are namely a 5 GB total database space limit, and a 10,000 record limit per object.

Datetime sensitive operations? Make sure your application can control its own dates

Posted on Feb 03, 2017

Just a short post about an old lesson that I was reminded of today.

I've done a few projects for some financial institutions that include date sensitive operations and calculations, things that have to be aware of the current date and will change values depending on what the date is, or processes that need to execute in a certain order and need to be completed all within the same day, etc.

One of the key things we realized early on is that we would need to build these calculations (and to some extent the processes) so that:

  • The calculations had the flexibility to be executed "out of time" ie. you had the ability to simulate what the current date/date time was so you could get the results out of the calculations that you wanted.
  • The system had built-in time-senstive reminders to prompt users to take certain actions and not forget.

In the former, this was important for a few reasons:

lightning:icon, Lightning Design System & Winter '17: did these people talk to each other?

Posted on Oct 20, 2016

I'm working on my first proper Lightning Component project, and the experience has been both frustrating and pleasant. Pleasant in the sense that it reminds me of my days working with Flash and Actionscript, where you'd build movie clips (child components) with discrete animations or functionality, and they would dispatch events to listeners on the _root level/stage. (your parent, master component) The correlation is made all the more stronger since we're dealing with UI in both situations.

At any rate, this is a short post to talk about the Winter '17 lightning component, <lightning:icon />, and the recommended markup for UI components provided by the Lightning Design System (SLDS).

JS to quickly check Salesforce field-level visibility checkboxes

Posted on Jul 07, 2015

This is a small, handy little javascript that will check all the checkboxes on the Field Visibility screen for a user profile.  Should work in the javascript console of all modern browsers.

var x = document.querySelectorAll(".displayedCol input"); for (var i = 0; i < x.length; i++) { x[i].checked="checked"; }

Sometimes while setting up objects and profiles for a project, you might do things out of order, or create objects using the Schema Builder or the Meta API, neither of which lets you set field permissions for user profiles.  Then you find yourself needing to go to each user profile, go to the field-level visibility settings of each object you created, and check all those boxes so the fields will be visible to the new profile.  The above javascript will check all the boxes for you; it's basically a "select all" for the Visibility column.

On using hash tags in your code comments

Posted on Jun 09, 2015

I write a lot of code comments. It helps me structure my code and make it a bit easier to scan, but it helps my future self too: understand why I did something; alerts for pitfalls or not so obvious code structures; etc.  I've also written apologies to other developers who may come across my code one day. :P

Something that I've started doing in the past year is "tagging" my code: adding hashtags to act as bookmarks to help me find key lines of code that are related to something I'm working on or something I did in the past.

Some examples:

// #tags #kludge #revisit

...or...

// #tags #2015rebuild #govLimits

They always start with "#tags" so I can find all the tags later (doing a search inside project files) and remind myself of what keywords I used, and then follow up with something more descriptive about whatever I'm tagging.

On VisualForce Governor Limits

Posted on Feb 09, 2015

It's been over a year and a half since my last blog post?  The time, it flies.  There were a number of projects that kept me super busy during that time, and only recently did things slow down.  It's a "good problem to have" as they say, but it's still a problem. :S

I ran into an issue recently with a Visual Force page I was generating for a project and thought I'd post about what I found, in case it can benefit anybody else. But first...

Salesforce and Code Rot

Posted on Jun 04, 2012

So I've been working with Salesforce for about a year now, as a developer and consultant, and something I've been running into a lot lately is code rot: code that lives tucked away somewhere and never gets updated 'cuz it's working and it was made by someone who's no longer in the picture and nobody knows what it does. Or code that has ceased to be relevant or used for months/years, but no one's stopped to go in and remove it. Or that thing that happens when you have a whole bunch of different people doing work on your SF org, and they're all from different companies and have different standards and levels of skill and so on, and nobody wants to take the responsibility of updating or fixing somebody else's current or old code.