Salesforce – Pushing Custom Buttons to the Limit With jQuery and Apex
As readers of my blog may also know, I freaking love jQuery. It’s just great. So how can we combine these awesome two things into something even better? Combine jQuery and Apex through the user interface for epic sweetness. First hard part is actually getting jQuery loaded in the dom, and making sure it’s ready. Second tricky part is calling your Apex method without having it become blocking and holding up the jQuery processing. In my example I want to display a nice dialog to the user while the apex code runs. It can take a while so I wanted the dialog to show up immediately and update the message when the apex call was complete. In the end, this is what I came up with.
Like I said, this is just more proof of concept and something to build on. This shows you how you can leverage jQuery in your standard object pages, as well as Apex to build some pretty awesome stuff without having to start trying to inject visualforce pages.