Encrypting and Decrypting on Salesforce and Node.js

Need to send secure messages back and forth between Salesforce and Node.js?  Whether it’s Heroku, AWS, or somewhere else, Node.js is an important platform to be able to communicate securely with Salesforce on.

Salesforce provides a fairly robust Crypto class.  I like the AES256 with Managed initialization vector (aka IV) that Salesforce provides.  The IV is 16 bytes of random/pseudorandom data that salts the encryption so the output is different every time even if the input is the same.  This prevents hackers from being able to spot patterns in the encrypted data, and makes it very difficult to brute force.  The IV gets prepended to the encrypted message so it is available on the other end when decrypting.

In Salesforce, Crypto.encryptWithManagedIV() and Crypto.decryptWithManagedIV() handle creating the IV, and prepending and parsing of the IV.

It’s pretty simple to build encryption and decryption using these methods on the Salesforce platform, see the example here.

But when it comes times to send and receive these encrypted messages on another platform, Node.js in this case, it becomes more difficult.  Managing the IV must be handled differently.  I found an article on how to do this with Java and a partial answer for Node.js.  But I couldn’t seem to find a complete, working example for Salesforce <-> Node.js.  So after I figured out how to make this work on my own, I thought I should blog about it to save others the trouble!

 

Saleforce

Here is example code of encrypt and decrypt, with some values from Node.js also included to be decrypted on Saleforce.

public class Encrypt {

    private static final Blob KEY = EncodingUtil.base64Decode('LHDK5bekAHJOFfXXzkd5uR/AoLBNPDNLIMAK8M0xss8=');    

/*

//execute anonymous example:

String secret = 'Shhhh..  This is a secret.';
System.debug('1: ' + secret);

String encrypted = Encrypt.encryptString(secret);
System.debug('2: ' + encrypted);

String encryptedAgain = Encrypt.encryptString(secret);
System.debug('3: ' + encryptedAgain);

System.debug('4: ' + Encrypt.decryptString(encrypted));
System.debug('5: ' + Encrypt.decryptString(encryptedAgain));

String encryptedfromNodeJS = 'cLaipdqsdGM/z+e+QjpqjUKeeQR26XSJdpUvgNE1areZHhB8DeAA+9xOgZO+wEe9';
System.debug('6: ' + encryptedfromNodeJS);

String encryptedfromNodeJSagain = '1NfNnjF5ROu3W9O8G14yzpjbpLDlEYjOjg/v1or5f7OgNZj+p/v3gdj5+NCR6olD';
System.debug('7: ' + encryptedfromNodeJSagain);

System.debug('8: ' + Encrypt.decryptString(encryptedfromNodeJS));
System.debug('9: ' + Encrypt.decryptString(encryptedfromNodeJSagain));

*/
    
    public static String encryptString(String clearText) {
        String encryptedText = null;
        Blob encryptedBlob = Crypto.encryptWithManagedIV('AES256', KEY, Blob.valueOf(clearText));
        encryptedText = EncodingUtil.base64Encode(encryptedBlob); 
        return encryptedText;
    }
    
    public static String decryptString(String encryptedText) {
        String clearText = null;
        Blob encryptedBlob = EncodingUtil.base64Decode(encryptedText);
        Blob decryptedBlob = Crypto.decryptWithManagedIV('AES256', KEY, encryptedBlob);
        clearText = decryptedBlob.toString();
        return clearText;
    }            
    
}

 

We can run this code in execute anonymous and we can see that we encrypt the same value twice, get two different encrypted values which decrypt to the same value.  We also decrypt two different encrypted values which came from Node.js and they decrypt to the same value.

 

Node.js

Here is example code of encrypt and decrypt, with some values from Salesforce also included to be decrypted on Node.js.

var KEY = Buffer.from('LHDK5bekAHJOFfXXzkd5uR/AoLBNPDNLIMAK8M0xss8=', 'base64');
const crypto = require('crypto');

var secret = 'Shhhh..  This is a secret.';
console.log('1: ' + secret);

var encrypted = encryptString(secret);
console.log('2: ' + encrypted);

var encryptedAgain = encryptString(secret);
console.log('3: ' + encryptedAgain);

console.log('4: ' + decryptString(encrypted));
console.log('5: ' + decryptString(encryptedAgain));

var encryptedfromSFDC = 'eFSWOcUjUiXKcfM+szX9HnjOZNTTCTUrxu82cwV0KR6AHNmp4X9PmNX8eQf4H1fG';
console.log('6: ' + encryptedfromSFDC);

var encryptedfromSFDCagain = 'Ed2oiBbyhZYm7P3kDvT7jYkg1p5e6Tb4xEEGaOPe/UznnZxEbr9pEmY6WVTWlWL6';
console.log('7: ' + encryptedfromSFDCagain);

console.log('8: ' + decryptString(encryptedfromSFDC));
console.log('9: ' + decryptString(encryptedfromSFDCagain));

function encryptString(clearText) {
	var encryptedText = null;

	var textBuffer = new Buffer(clearText, 'utf-8');
	var iv = crypto.randomBytes(16);

	var cipher = crypto.createCipheriv('aes-256-cbc', KEY, iv);
	var encryptedBuffer = cipher.update(textBuffer);
	encryptedText = Buffer.concat([iv, encryptedBuffer, cipher.final()]).toString('base64');

	return encryptedText;	
}

function decryptString(encryptedText) {
	var clearText = null;

	var encryptedBlob = new Buffer(encryptedText, 'base64');
	var iv = encryptedBlob.slice(0, 16);
	var textBuffer = encryptedBlob.toString('base64', 16);

	var decipher = crypto.createDecipheriv('aes-256-cbc', KEY, iv);
	clearText = decipher.update(textBuffer,'base64','utf-8');
	clearText += decipher.final('utf-8'); 
	
	return clearText;
}

 

We can run this code via command line and see that we encrypt the same value twice, get two different encrypted values which decrypt to the same value.  We also decrypt two different encrypted values which came from Salesforce and they decrypt to the same value.

Now you can talk securely back and forth between Salesforce and Node.js to your heart’s content!

Here is the full code on GitHub: https://github.com/danieljpeter/SalesforceNodeEncryption

 

 

 

A Salesforce Conference in Uruguay? YES!

TL;DR: Unbeknownst to many, there is a large, talented population of Salesforce developers in Latin America.  I had the privilege of making the long voyage to Uruguay to meet many of them, get to know them a bit, learn about their beautiful country, and bring them some Salesforce knowledge of my own.  It rocked! (skip to pictures at bottom)


Punta Dreamin’ – Strong Salesforce Community in Latin America’s Technology Hub

I was extremely fortunate to have the chance to speak at the first Latin American Salesforce Community Conference.  Punta Dreamin’ was held in the resort city of Punta del Este, not too far from the largest city in Uruguay, Montevideo.

The event was held at the elegant Hotel Conrad, which is right across the street from the beach.  This venue has all the needed amenities and plenty of room for future growth!  We gathered in a common, great room where we all shared the sponsor and speaker activities of the day.  There were no parallel sessions going on, just one experience.  It was a FOMO-free event! (unless you weren’t there at all)  As one described it, “One track in a continuous and dynamic show that integrates speakers, attendees, sponsors and the glamorous Conrad experience”.

There were a mix of Spanish and English presentations.  In fact, Angela Mahoney delivered the entire opening keynote in Spanish, and English in her first language.  Amazing!  Punta Dreamin’ was a technical conference, aimed primarily at Salesforce Developers and Architects.  This was reflected in the top notch content of the sessions, and even though my Spanish isn’t as good as it could be, I still got a lot out of the program.  By paying attention to the graphics on the slides and picking up 20% or so of the words, I was able to learn from all of the sessions.

I did some walking around the town before the conference to get a feel for the local vibe.  I noticed everyone drinking maté out of gourds with metal straws.  This highly caffeinated tea with a distinct flavor is enjoyed all over by everyone.  I think Uruguay is fueled by the stuff!  Luckily several of the sponsors brought some so we could try it.  This was just the ticket to get an energy boost before delivering a presentation to a packed house.

Uruguay is a wonderful country to visit.  I’m a little jealous of the Salesforce developers that get to live there.  Walking around and exploring revealed much of it’s charm.  Rustic houses, unique works of art, tranquil beaches, tasty and satisfying Chivitos, green pastures with bright blue skies, unselfish and welcoming people, even urban city life.  It’s easy to leave a piece of your heart there.

I had several great conversations with Aldo Fernandez, who is one of the folks responsible for “dreaming” up this dreamin’ event.  He described “El Maracanazo” to me, an important part of Uruguayan and Brazilian culture.  This was one of the largest upsets in the history of sports where Uruguay beat Brazil 2-1 in the 1950 World Cup.  This took a huge toll on Brazil.  It is described as being Brazil’s version of Hiroshima, it was that bad.  Yet on the flipside, it instilled a strong sense of ability to achieve amazing things within the Uruguayans.  To put these countries in a US size perspective, Uruguay is smaller than the state of Washington and Brazil is almost the size of the entire United States!  Punta Dreamin’ was not El Maracanazo, there was no tragic loser.  However, I felt the spirit of that small country and its confidence in its ability to be a world player fueling the success of this conference.

Uruguay certainly has its share of talented software developers.  It was a pleasure getting to meet some of them.  They are a 7,000 mile flight away from the Bay Area, and in the Southern Hemisphere of the world.  Perhaps this geographic separation has something to do with the lack of global awareness.  But there is no denying they are a major exporter of “nearshoring” software and IT services for many other countries with the highest per-capita numbers for this in Latin America.  Uruguay has become Latin America’s outsourcing hub, with companies like Tata Consultancy Services setting up their Spanish speaking headquarters there.  There are also many tech companies headquartered in Uruguay doing their own work, and a growing startup scene as well.  A country with low crime, natural beauty, smart people, and amazing technology resources.  What kind of well-guarded secret is this place?

Now, the secret is out!  Punta Dreamin’ was a huge step forward in making this known within the global Salesforce community.

Traveling is learning.  Meeting new people is learning.  Being a software developer means you can never stop learning.  No matter how skilled you are, there is always more to learn.  One of the great things about these conferences is the opportunity we get to cross-pollenate technical and cultural knowledge between communities.  I presented a session on an open source project I’m working on called HyperBatch.  One of the attendees who saw the presentation reached out to me to say, “Thank you for coming this far South to talk and inspire our thoughts about what’s actually possible”.  That clinched value of me participating in this event right there.


Salesforce Culture in the Extended Ohana

Salesforce has the four core values of Trust, Growth, Innovation, and Equality.  I can frame my experience as a speaker at this Latin American conference within these values.

Trust

I trusted the travel would be worth it, they trusted I would bring value to the event.

Growth

I grew personally from the experience, while attempting to grow the awareness of the Latin American Salesforce Community.

Innovation

The Punta team innovated this entire conference, it was the first of its kind.  I was sharing my own innovations with the group as a speaker.

Equality

Latin America’s Salesforce professionals deserve equality of recognition and compensation.  They deserve a conference, too!  As a visitor to their country, I was treated with equality and felt welcomed.


Sponsors

The sponsors of this event were amazing.  I didn’t get a chance to talk to all of them, but I did get to most of them.  I loved talking with these folks so much, I am listing them here so you can check them out for yourself.  These are world-class organizations with some of the friendliest people you could ask for.  Have a look to learn more about Uruguay tech.


Additional Reading


Fotos


 

Snowforce 2017: The Salesforce Crossroads of the West

There are over 15 Salesforce community conferences now, but Snowforce is one of the oldest. Based in Salt Lake City, Utah, it has a large and growing group of loyal followers. Utah is quietly becoming the next Silicon Valley. It’s been named the Silicon Slopes, and increasingly it’s got the numbers to back it up. Don’t overlook Utah, it’s going through a tech boom, and Snowforce is a great way to network and learn from the folks who are part of it.  Read on to hear about my experience at Snowforce!

The night before the conference, there was a speaker / sponsor dinner. These extra activities are so important because the day of the conference flies by so quickly. Many times this is your only chance to talk to certain people (Peter Coffee for example). I met some new folks and got a chance to talk to them in a fair amount of depth. I also got to re-acquaint with familiar people which I hadn’t seen in some time. Finding the venue was a test of our navigation skills, as it turns out the “Red Iguana” can mean many different places in Salt Lake City 🙂

Checking into the conference was a breeze. Since it was downtown this year, it was a short walk from the hotel. The venue was one of the coolest I have been to. “The Depot” is a train station converted to a music venue. Hosting Salesforce rockstars in a place that hosted literal rockstars is quite befitting.  TrailheaDX did something similar at the Warfield. It’s a nice alternative to traditional convention centers.

 

 

 

Peter Coffee’s keynote was thought provoking and flawless as always. Prior to the conference he used a poll to crowdsource the topics. This meant he ended up talking the most about topics we were most interested in. Way to be customer focused! I’m still processing these important ideas. No doubt they will help my career, and maybe even help the world a little in the process. He really makes it worth getting out from behind your desk and flying across the country to expand your mind.

One difficulty with a conference this size is that there are 3-4 parallel sessions going on at once. Inevitably this means you will have a feeling you are missing out on the sessions you aren’t in. My advice is to accept you are going to miss out on many sessions.  Be comfortable in the session you have chosen and experience the session you are in with elevated mindfulness.

I think this is the first community conference I have been to that provided it’s own mobile app!

                                

This was a private social network, similar to the Dreamforce app.  I saw a lot of people interacting on this who weren’t on twitter, so this makes it a valuable addition to the conference in my opinion.

I enjoyed the SalesforceDX presentation by John Vogt and Wade Wegner. This is a massive and ever-evolving body of knowledge, so it’s important to stay informed. I especially loved Wade’s demos. He really puts the X in DX by showing how quickly you can build apps via the new CLI tools. Marc Benioff even got wind of this presentation and retweeted what was going on in the room!

Kevin Poorman (aka codefriar) showed off his innovative “Apex Promises” project. This looks like a great architecture to build robust processes that are long running and/or use multiple callouts.

The sponsors had their own room which seemed to be getting plenty of traffic. I popped in a few times and it was always packed with attendees. My company, Kenandy had their team in there giving away swag and answering questions about our ERP built on the Salesforce platform. It was also great to catch up with other sponsors like Coveo, who generously helps to pay for the video production at the Bay Area Salesforce Developer Group.

Lunch was included as part of the conference by gourmet food trucks out in front of The Depot. It was a little tight for space, but the food was excellent. Salt Lake City has no shortage of good eats! It’s really cool being able to create your own lunch experience by perusing around the trucks and choosing whatever looks good.

 

After lunch, a new Salesforce MVP, Adrian Larson presented his LimitsProfiler project. This solves a problem which is a bit of a dark art to many Salesforce Developers – performance. You can refactor code and gather data on how you have affected the performance of it. Cool!  I also found out Adrian is one of a very small number of moderators on Salesforce Stack Exchange.

 

Morgan Robertson, a Technical Architect at Eide Bailly gave a useful demo on Custom Metadata types. It was an end to end demo of a commission calculator app where the commission tiers are stored in Custom Metadata Types. The best part?  All the source code is available here: https://bitbucket.org/eidebailly/custom-metadata-example.

Who says work can’t be fun? I invited the Simplus SaaSquatch to come to my session on HyperBatch and it showed up! It even had a few words for the audience. Something to the effect of “hwooo uuugh oooowah woooo uuuuah”. The ‘squatch even came equipped with some foam snowballs we got to throw around. Hopefully it learned a few things about Salesforce in the process.

Similar to last year, Snowforce had a closing keynote packed with great life advice. Mark Widmer, Ph.D. from BYU gave us meaningful advice on how to live a great life. This focused primarily on myths and truths about how to increase your happiness. Mark has a lot of experience in outdoor team building activities, so his talk dovetailed perfectly into Snowforce’s day 2 activities on the slopes! Work-life balance is so important, kudos to Snowforce for incorporating this into the conference.

There was a closing happy hour event, a great opportunity to connect virtual relationships to the person in real life and discuss what we learned that day. It was also a chance to assemble a large group of us to grab dinner. Dinner presented a new opportunity exchange life stories which add whole new dimensions of depth to business relationships. Everyone has an amazing story when given the chance to share it.

The second day is an entirely different experience. This is what puts the “Snow” in Snowforce. Conference attendees meet up at the Solitude Mountain Resort and decide how to spend the day. There is a lodge provided as home base with food, drinks, and space for hanging out. Groups of people form organically for all types of snow activities from here. I chose to try snowshoeing for the first time with a few other people, which proved to be a very rewarding experience. Sun, snow, and majestic scenery set the stage for a challenging, shared experience for us to connect through.

There are a lot of people I’d like to give a shout out to for making Snowforce 2017 such a wonderful experience.  But rather than risk missing some folks, I’m just going to say if you are reading this, then you know who you are.  Thank you!

French Touch Dreamin’: Where We All Speak Salesforce

NOTE: Before reading any further, start this song playing for the proper ambiance:

Music playing?  Great, read on…

img_0405

 

You may have heard of Midwest Dreamin’, Tahoe Dreamin’ or some of the many other Salesforce community conferences which may or may not have the Dreamforce-esque “Dreamin’” in their title.  Now you can welcome French Touch Dreamin’, a community event in Paris, to the lineup.

They could have simply called it France Dreamin’, or Paris Dreamin’.  But French Touch Dreamin’ conveys the spirit of the way in which the organizers of this conference infused it with their touches of France.  This delivered a very French experience!  The song you are listening to right now is also of the “French Touch” dance genre.  That might just explain all the great music which was played throughout the conference as well!

img_9701Two days before the conference I had a meeting at the Salesforce France headquarters.  They are housed in a modernized, historical building with the best view of the Eiffel tower imaginable.  Thanks to Jean Michel Mougeolle for helping to set this up.

 

img_9790img_9977The night before the conference we had some preliminary gatherings such as Happy Hour put on by Holly Goldin Firestone and a Speakers Dinner.  These activities were an excellent chance to catch up with folks in the Salesforce community and get some hints of what the conference the next day was going to be like.  I was thrilled to get to sit with Peter Coffee and Shivanath D. at the dinner.  There were brilliant conversations going on all around the table that night!

Thursday morning kicked off with a surprise musical introduction:

img_9806

And an enlightening community-themed keynote by Holly Goldin Firestone:

18 world class sessions went on throughout the day in 3 different locations at the super cool Pan Piper venue.  This venue was not only perfect in terms of size and layout, but also had the French Touch!  These sessions were a great opportunity for thought leaders to share their content with a worldwide community, in person.  I learned a ton from the sessions that I saw, and especially appreciated the diverse perspectives.

img_9960
(photo courtesy frenchtouchdreamin.com)

I had a great time presenting my session on HyperBatch.  The A/V support was excellent.  They had a remote clicker and plug-in internet available which were the icing on the cake.  I got some great questions from the audience, and I look forward to my project being used by the Salesforce community.

 

img_9798In between sessions there was plenty going on:  sponsor exhibitions, French food, wine, and coffee, a DemoJam, Trailhead Contest complete with buzzers, photo opportunities, and an outdoor patio area.  The day flew by really quickly with so many great options for things to do.

 

img_9934The one and only Peter Coffee gave the closing keynote.  Peter is one of the most recognizable Salesforce personalities, and has interviewed the who’s who of the Salesforce ecosystem.  He’s even interviewed the founder of Kenandy!  This was not your typical, glossy, “everything is amazing” type of presentation.  Peter took a hard look at many trends he is seeing, and gave us concrete advice on how to move ourselves and the industry forward.  This honest look at things was refreshing, and provided serious value to the attendees.

It goes without saying, the organizers really outdid themselves on this event.  If you were thinking of going in 2016 but didn’t make it, don’t miss it next year!  I’d also like to extend a personal thanks to the sponsors.  Without them, these types of community events could not exist.

img_99492016-11-27_21-14-32

 

 

Although it was a European conference, there were attendees and speakers from all over the world. People from 13 different countries were there!  The organizers decided to use English as the common language at the conference.  But I say that we were all united by the common language of Salesforce.

img_9975

For more information

 

 

 

Snowforce 2016 Recap

Salt Lake City’s Snowforce Salesforce event keeps getting bigger every year.  This was the 6th year, and it is now drawing around 300 people (with even more registering!) from all over the country.  The tech scene is strong in the Silicon Slopes and surrounding areas of Utah.  There are many companies in the Salesforce ecosystem located there, as well as remote employees who live in Utah with headquarters in places such as San Francisco.  About five Utah user groups pitch in with funds contributed by the sponsors to create this event.  And believe it or not all of this is absolutely free for the attendees!

Noah’s Event Venue was a great location for the event.  Multiple floors held various rooms for breakout sessions, sponsor expos, photo booths, and lounges for attendees to hang out in.  There was even a game room upstairs if you wanted to discuss Salesforce over a game of pool.    The large, main hall which was big enough to be able to fit all of attendees together at once for the keynotes.  Snowforce had sessions catered to four different tracks this year: Admin, Developer, Executive and UX.  Four tracks for a community conference?  Wow!  I attended the Developer track.

The conference kicked off with registration and breakfast starting around 7:30 in the morning.  Breakfast was good, but disappeared fast.  Thankfully the staff was on top of it and ordered more!  Saleforce sent a great group of expert Account Executives and Sales Engineers to the early bird session on Service Cloud Lightning.  Joined with folks from Instructure, we got real examples of how Salesforce’s fastest growing offering, Service Cloud Lightning, is helping companies to better service their customers.  I was particularly excited to see Jennifer Shaeffer there.  Jen is a seasoned Salesforce Account Executive who I have worked with in the past.  She did a great interview with Instructure that was reminiscent of Peter Coffee’s Dreamforce intros.

For the keynote, we had an all-star lineup of Salesforce Admin and Developer evangelists.  This worked great since there was a mixed audience.  Gillian Madill and Mike Gerholdt showcased the latest features of Salesforce that an admin might want to know about such as customizing the new Lightning Experience navigation.  Samantha Ready took over and showed some of the new developer features like building components and using them in Lightning App Builder.

 

After that we had a Demo Jam.  It was a fast-paced forum where vendors got the chance to belt out their best elevator pitches for their product, and attendees got to vote on them via SMS.  It was very entertaining as the presenters were cut off when they reached their time limit.  So hearing a presenter close with a pitch along the lines of “It’s awesome!!!” happened more than once.  The new Simplus App “Culture Climb” was demoed by the always energetic Ryan Westwood, and featured a dramatic mic drop at the end.  This is a brand new HR app which was unveiled at the conference and ultimately won the Demo Jam.  This will be an app to keep an eye on.

 

I broke out into breakouts and learned some great Developer content.  The first one I saw was by Nate Lipke of Salesforce.  He demoed a nice smattering of the new toys developers have to play with such as the Interactive Apex Debugger.  It was extremely cool to watch a Visualforce page stop in mid form submission and let you inspect everything from the server side.

nate

This took us into lunch, featuring a lineup of Utah’s finest food truck fare.  These were a huge hit with the attendees, and were provided free as part of the conference.  What a fun way to enjoy the warm weather outside while hanging out and meeting new people.  Kudos to the whoever planned for this conference lunch hack.  It delivered an all-around great experience.

After lunch, Charlie Isaacs, gave an action packed presentation.  Charlie is the CTO for Customer Connection at Salesforce.  If you haven’t seen him speak, it is something to behold.  I’m sure he had 10 presentations he wanted to give in parallel in his head but unfortunately he only has one mouth to be present with.  Passionate and knowledgeable about the Internet of Things don’t begin to describe Charlie.  IoT is becoming more and more common across many industries.  Charlie passed around estimote beacons which are used in retail, ODBII dongles which are used by insurance companies to monitor drivers, even a connected knee implant that is enabling more successful knee surgeries.  This was probably my favorite presentation, as it made the Salesforce IoT Cloud tangible for me.  At Dreamforce 2015 “the IoT Cloud, powered by Thunder” was Parker Harris swinging the hammer of Thor at the stage with thundering sound effects.  While cool, this was a little abstract.  Charlie’s session made it more clear to me what the actual product is, and what it will be able to do for customers.  I believe IoT Cloud will be huge, and have a more successful adoption curve than Analytics Cloud has had.  IoT cloud takes what can be an extremely complex implementation, and simplifies it down to the realm of Salesforce declarative development.  This will enable businesses to leverage machine-generated data to better serve their customers in a fast-to-market fashion.  What an amazing capability.  It will be exciting to watch Kenandy customers leverage this when it becomes generally available.

 

John Schultz, a developer at Salesforce, gave a cool presentation on how to integrate Salesforce and fitbit.  All the code for how to do this is in his github repo here: https://github.com/jcschultz/sfdc-fitbit-demo.  This was a good refresher on OAuth flows, REST integrations, and also showed the benefits of using a treadmill desk.  It was really cool to be able to talk with John the next day about his experience of being a software developer who uses a treadmill desk.  There are a lot of issues you don’t think about such as how the eyes adjust to the motion, and how you might need to pause the treadmill while taking phone calls.

john

The final Developer presentation taught us how to create Process Builder Blocks.  This is a useful technique if you have admins and developers working in together in an organization.  The admins can build as much of the process as they can in Lightning Process Builder, then the developers can create Apex methods which can be executed from the Lightning Process.  To me, the most amazing thing about this presentation was that is was created by Shane McLaughlin, a Platform Architect at Salesforce.  Shane was supposed to present this, but something came up, and Daniel Hoechst stepped in at the last minute to present it on his behalf!  As if organizing and executing the event wasn’t enough, Daniel was even able to do Shane’s presentation for him.  In fact, if he hadn’t told us it wasn’t his presentation, we wouldn’t have been the wiser.  Quite an impressive feat in my book.

daniel

The final presentation brought everyone back together from the breakouts into the main keynote hall.  This was a motivational speech by Dr. Craig Manning.  Dr. Manning is a great presenter with an Australian flair.  He teaches at Brigham Young University, and has worked with some of the world’s top athletes.  Though his experience is in Athletic performance coaching, the concepts apply to anything you want to accomplish in life.  He explained how to achieve “The Fearless Mind” using this formula: Potential + Training – Interference = High Performance.  He gave us a short list of actionable things we can do to achieve this, which sounded quite good to me.  He also challenged various beliefs that are common in our society.  It was an hour well spent.  It is important to take time out of our busy lives to explore techniques for self-improvement.  Working this into the conference was a nice value-add.  It wasn’t unlike the the mindfulness theme which was added to Dreamforce 2015.

manning

Wrapping up the official events for the day was a cocktail hour out on the balcony.  This included an open bar, food, snow machine, heaters, and music.  It was a great networking opportunity, with scenic views of the towering, snow-covered Utah mountains on both sides of us.  I caught up with a few people I had been meaning to talk to, and learned a lot by listening to the conversations of others.  As the crowd dwindled down, the remaining group planned to go out and grab dinner.  We all pitched in to pack up some items from the event, a reminder that we were indeed at a community conference!
We met up for dinner in downtown Salt Lake City, at a dueling piano club called Keys on Main.  The piano players were amazing, and really knew how to work the crowd.  It was a unique and entertaining experience, and a great chance for the local Salt Lake City Saleforce crowd to show the out of towners what their city has to offer.

 

keys

The next day everyone met up at the Solitude Mountain Resort for a day of snow activities and networking.  The organizers reserved us a good sized room there for our base of operations.  The room had food, drinks, networking, and gave everyone a place to change in and out of their snow gear.  It was a lot of fun to see people coming back from the slopes with huge smiles on their faces, exchanging top speeds from their smartphone GPS apps.  I was a little under the weather, so I didn’t participate in any of the vigorous activities.  I enjoyed the scenery, and skied vicariously through the stories of others.  The weather felt like a summer day, with the snow reflecting the sun at you like a tanning mirror.  There were restaurants, pubs, and gift shops around the lodge.  I had fun exploring and finding new places to hang out in small groups.  This is where serendipitous conversations around Salesforce and other topics tend to happen.  I also took a nice snow hike along a ski run / snowmobile trail with Zachary Jeans, a Salesforce strategy consultant, getting some decent exercise for the day.  Being 8,000 feet up in the pristine mountains makes you feel isolated from the stresses of life, and you can’t help but soak it all in and feel at peace.

 

It is impressive just how well a group of volunteers in the Salesforce ecosystem can organize an event like this.  I know Snowforce 2016 didn’t plan and run itself, but the organizers made it seem that way from an attendee’s perspective.  It was remarkable how collected the organizers were, considering the late nights and countless details they had to keep track of up to and during the conference.  Congratulations and thanks are in order to Daniel Hoechst, Ben Schauerhamer, Evan Johnson, Drew Dayton, Becky Webster, Carolyn Beth Adams, Kim McClure, and Brian Warren.  If I left anyone out, please let me know (@danieljpeter on twitter) and I can revise the list.  I can only imagine this event will continue to grow!

To learn more about Snowforce, check out these resources:

http://snowforce.io

https://success.salesforce.com/_ui/core/chatter/groups/GroupProfilePage?g=0F9300000009N

https://twitter.com/search?q=%23snowforce16

 

 

 

 

 

 

 

Tahoe Dreamin’ 2016: How Less Can Give You More

Dreamforce is THE software conference.  Period.   I’m a long-time, repeat attendee, and I get a huge amount of value out of it each year.  However, I always walk away feeling like I missed out on most of it because there are so many things going on at the same time.  There are always 3 events I want to attend which are starting half way through an event I’m already sitting in and don’t want to leave because it is sparking innovative new ideas in my mind.  And then what about that list of people I promised I’d meet up with, where do I squeeze them in at?  Sleep is required, yet also optional in the face of so many extravagant parties going on.  If you’ve been there, you know exactly what I mean.  It’s an accepted side-effect of delivering massive amounts of awesomeness in a short period of time.

What would it be like if you took a sprinkling of the same attendees and speakers, and put them into a Salesforce conference where you gave the sessions and events a little more time and space to breathe?  What if there was a venue with a framework which set the tone for like-minded people, but left opportunity for serendipitous experience?  What if you could throw agenda builder, and google calendar out the window for a weekend and still feel like you got everything done and more?  It is possible, and I just experienced this at the inaugural Tahoe Dreamin’ 2016.

This was the first time I’d been to a community-organized, regional Salesforce conference. Knowing the value of diversity of experiences, I had been wanting to check one out.  This one was in my backyard, so it was a convenient way to make it happen.  The cost was very low as compared to Dreamforce.  It was more about justifying taking a couple of days off from work.  I decided to present a session there which made the justification easy.  It was an opportunity to share some knowledge and give back to a community which has afforded me a rewarding career, which I am very grateful for.  As well as create some awareness for the company I work for, which has been a catalyst for my career, which I am also grateful for.  Building a full-blown ERP on top of Salesforce has been a trial by fire, which has made doing almost anything else on the platform seem easy by comparison.  There is no substitute for that experience, and I love sharing the battle stories of doing that with the Salesforce community.

I decided early on I should rent a snow-ready vehicle and share the cost by carpooling.IMG_1166  This way we wouldn’t have to worry about chains or getting stuck in the snow.  This was probably overkill, but I liked the peace of mind of being prepared.  Bill Greenhaw matched up carpool providers with those in need of a carpool, and this worked out great.  Carpooling was smooth and enjoyable and allowed me time to get to know the people riding with me.  I had admins and developers with me who were all doing very different and interesting things with Salesforce.  This was a great learning experience.  When I picked up my first passenger, this is actually when the conference started to begin.

I arrived Thursday night and rushed up to my hotel room in full Dreamforce mode to plan my agenda for the night.
IMG_1167 IMG_1168 IMG_1169
I quickly realized there was only one thing going on.  Wow, that was refreshing!  No guilt about missing out, and a chance to meet everyone.  The event was sponsored by Shonnah Hughes & Toya Gatewood.  They did a great job of providing a happy hour style meetup which gave me the chance to meet many new people such as Katie McFadden and Stuart Edeal and consider aspects of Salesforce I don’t often think about in my daily routine.  It also gave me a chance to catch up with people I already knew, and felt like I knew from online interactions.

The next morning I woke up early to go downstairs for coffee and ran into Zachary Jeans.  We had a nice, long, slightly philosophical conversation over some Starbucks.  A great example of Tahoe Dreamin’ serendipity.  Once I was primed with coffee, I put on my #AlohaFriday shirt and sat in on some great sessions.  Adam Seligman and Shawna Wolverton upped the “juvenile marketing” ante and rocked the house with deliciously tacky, retro ski outfits.
CZVxPlMUAAE4sfTIMG_1170
They gave us lots of great content such as unpublicized features way out on the roadmap.  Team ButtonClick,  Mike Gerholdt and Gillian Madill were at the keynote as well, helping to run the video of Parker Harris and Alex Dayon wishing us all a happy Tahoe Dreamin’.  I ran into more people I wasn’t expecting to see, such as Stephan Paquet, a first-rate developer from the North Bay Developer User Group I used to run.

All the sessions I attended were Dreamforce quality or better.  Yet there was something different.  The speakers, myself included, were more relaxed, confident, and open to questions.  IMG_1187Perhaps it was due to the absence of scheduling overload, or the fact the sessions weren’t recorded.  Whatever it was, I liked it, and I’m pretty sure everyone else noticed it as well.  I attended mostly developer sessions, and got plenty of takeaways to justify the trip.

I had diamond in the rough “ah-ha!” moments while Samantha Ready talked about Lightning Out while simultaneously pulling off an ambitious, live demo on hotel wifi.
IMG_1175IMG_1184IMG_1181
Listening to Pat Patterson talk about Forcecraft (Salesforce integrated with Minecaft), I finally gained an appreciation for the concepts it represents, something I never got the chance to do at Dreamforce due to schedule overload.
IMG_1200IMG_1198
Daniel Hoechst showed some tools for Continuous Integration which helped to validate the concepts I use myself at work.
IMG_1202IMG_1205
But between these sessions is where the magic had a chance to happen.  There were 15 minutes, sometimes an hour between them. This free time could be used to hang out in the room and talk with the presenters, converse with the people next to you, meet up with groups of people outside the room, stop by the exhibitors in the trade show area, or hop on your selfie bandwagon of choice.  There was amazing food and drinks o’plenty, which kept the day and the conversations flowing.  There was no excuse to leave if you didn’t want to.  The pacing of the sessions, breaks, lunch, happy hours, was varied, and in my opinion, perfect for a conference like this.  Taking a play from Foo Camp’s playbook, they gave us a canvas and paint to create our own masterpieces.  However, the figurative paint by numbers or even magazines were still on hand for those who prefer more structure.  The key takeaway here is that less actually leads to more.  Passionate attendees can fill the space better than event planners when given the opportunity.  And therein lies the beauty of the community conference.

Dinner was a fancy sit-down affair with a buffet of some of the best food I’ve ever eaten.  The dinner alone was worth the $100 ticket price of the entire conference.  It included plenty of time to talk with your neighbor or switch tables and talk to other people.  There was an impromptu toast to Bill Greenhaw for pulling off such a successful event, as well as some valuable prize giveaways.

After the event the attendees were free to put away their lanyards and badges and explore the nightlife of the area.  I wound up in a live music bar with 10 or so other folks from the conference.  IMG_1214Some I had met that day, others I had already known.  This was a refreshing chance to NOT talk about Salesforce and instead enjoy the fact that we are also people who do things other than sit in front of computers.  Such as listening to a cover of the Eagles with a cold bottle of beer.

Saturday was the Tahoe Dreamin’ fun day.  There was quite a list of activities to choose from.  I chose to try snowmobiling, since I’ve never tried it.  IMG_1221I ended up in a group with Zachary Jeans, Pat Patterson and his family, and Jean Michel Mougeolle (he came all the way from Paris, and gave a session that was the talk of the conference).  It turns out snowmobiling is some of the most fun you can have without breaking the law.  It was like being in a Speeder Bike scene out of Star Wars.  We climbed the deeply snow-covered hills from 7000 feet to 9000 feet on what are mountain bike trails in the summertime. Up and down hills, speeding around curves, never knowing what we would see next.  The mix of adrenaline from the ride, and the breathtaking scenery you get to see is difficult to put into words.
IMG_1224 IMG_1234 IMG_1236 IMG_1237 IMG_1240 IMG_1241 IMG_1244 IMG_1245 IMG_1250 IMG_1255 IMG_1259 IMG_1261 IMG_1263 IMG_1272 IMG_1285 IMG_1293 IMG_1297 IMG_1299
Photos do not do it justice either.  Emerging from the wooded trails into panoramic views of Lake Tahoe thousands of feet below you, in potentially deadly weather, was a religious experience.  You couldn’t help but high-five the people around you.

After coming down from the snowmobile high, Jean Michel Mougeolle and I got a nice lunch at a cafe.  I learned more about the innovative image platform he is building, delivered in his wonderful french accent.  I think it made my lunch taste better.

We met up with Zachary Jeans, Eric Dreshfield, and Stuart Edeal for gondola ride to the top of Heavenly.  We relaxed and enjoyed the scenery around us as the cable pulled us high up the face of the mountain, and everything below got smaller and smaller.
IMG_1306 IMG_1312
We stopped at the observation deck for awhile and tried not to freeze to death while we took some photos.  The protip for survival was keeping the icy wind to your back.IMG_1319 CZcx822UsAIDIsu
We then got back on the gondola and continued to the ski lodge. The lodge and surrounding areas were bustling with 100s of skiers and snowboarders.  We took the opportunity to duck into the lodge and thaw out with a round of coffee.
IMG_1321 IMG_1324 IMG_1325 IMG_1327
While inside the lodge, the conditions outside got progressively worse.  We finally were alerted we needed to get off the mountain before everything shut down.  The trip down was a chance for some more reflecting on the day and joking around.

Once at the bottom I gathered up my fellow carpoolers, said goodbye to Tahoe, and we drove back to the bay area in the dark of night.  This was another opportunity to have some in depth discussions on the nuances of developing on the Salesforce platform and learn from each other.

Did the sponsors of Tahoe Dreamin’ go home with hundreds of qualified leads?  Probably not.  Was there a Tesla raffled off?  No.  But was this conference a complete and total success in the areas that matter the most?  Without a doubt.

Hack your Dreamforce experience to make it even more #Awesome

Dreamforce is the largest software event there is.  If you are a cloud computing practitioner, it is the best opportunity of the year to learn, network, and get inspired.  But it can also be overwhelming if you don’t approach it with the right mindset, or show up unprepared.

I’ve attended Dreamforce 5 times before, and put together some unique tips for you to get the best experience possible.  Some of these are a bit unconventional, so if you are into life-hacking, give them a try!

  1. I’ve always been local or driven in and stayed with friends in SF.  Despite the huge number of attendees, I’ve never had a problem finding parking in the local garages.  In fact, I find them to be rather empty!
  2. Many sessions are recorded.  Consider skipping some of these sessions if you don’t need to talk with the presenters or attendees live.  Take full advantage of the in-person opportunities and time shift some of the sessions to post-dreamforce video watching from the comfort of your couch at home.
  3. Walk around the dev zone and the exhibition halls and don’t hesitate to ask questions about anything which may interest you.  Heck, even things which don’t interest you!  In practically every case you will find the people working the booths will teach you something relevant you didn’t expect.  You would have never found this out if you didn’t talk to them.  Plus they are very friendly and motivated to talk to you.   Learn the art of asking the right questions, and not lingering any longer than is necessary – there is so much to see!
  4. Tweet your experiences with the #DF15 hashtag.  You’d be surprised how many people follow this hashtag, and it helps those who can’t attend to feel like they are part of it.
  5. If you decide to attend the keynotes, get there EARLY.  Consider an hour early for the main keynote as it always ends up in overflow.  You can watch the keynotes recorded, but it’s like watching star wars at home vs. on the big screen.  You work hard all year long, and a live keynote is a chance to recharge yourself and be inspired.
  6. Get excited about all the amazing demos, but remember they are just demos.  They may include features which aren’t generally available yet, or be the product of tons of custom work.  What you see might not be exactly what you get when you “open the box” when you get back home.  They represent what is possible, perhaps in the future.  They don’t always represent the current offering.
  7. The extra-curricular events put on by salesforce partners are a great networking opportunity, and provide free food and open bars.  Be sure to check out at least one of these, and enjoy in moderation.  They add a unique dimension to your dreamforce experience.  Keep an eye out for ones which provide products or services you are actually interested in, and conversation will flow naturally around this.
  8. Be careful with sessions in different buildings on campus.  For example Moscone West to Palace Hotel is a long, brisk walk to do if you have back to back sessions.  Some exercise if good, but you don’t want all your sessions to be spread out in this way.
  9. There are different free lunches to be had in different buildings.  If you happen to be in a campus hotel with sessions around lunch time, you may get something unique which isn’t offered in the Moscone area.
  10. Wifi and cellular networks become saturated to the point where they don’t work.  Find out how to change your phone settings to fall back from LTE to 4G->3G->Edge.  Using the older networks will often work when the newer ones fail.  Slow connection is better than no connection.  Don’t forget to switch it back, though!

In addition to this list, there is a Dreamforce Trail on Trailhead.  Trailhead is the new salesforce learning path tool which makes learning interactive and fun.  The dreamforce trail will teach you a ton of good information you need to know to have a successful dreamforce experience.  It will also let you get your feet wet with Trailhead if you haven’t used it before.  You earn a badge for completing it, which will make you want to learn more and earn more badges in other areas of salesforce.

DF15readyBadge

Tips on Passing the Salesforce Certified Technical Architect Multiple-Choice Exam

tech_arch_partial

 

It’s been on my “to-do” list for some time… and today I’m happy to say I passed the Salesforce Certified Technical Architect Multiple-Choice Exam!  Of course I still have the infamous review board presentation, but I thought I would share my experience thus far.

After working on the platform since 2009 and taking the other 6 exams, this one really wasn’t too bad for me. But just to be safe, I took the process very seriously. After all, it is $500 with a $250 retake fee!

Past Experience is Key

Here’s some of my hands-on experience, which was very relevant to the exam:

  • Past work with integrations.
  • Architecting a wide variety of creative solutions across all the clouds.
  • Years of heads-down development work.
  • Multi-tenant and large data related issues, such as query optimization.

Review

I went through the study guide and marked anything I felt I needed to brush up on:

study guide

To review I watched the salesforce video training available through the partner community help and training on topics like Integration, Multi-Org strategies, Governance, and SSO / OAuth. Any topics I wanted to study and couldn’t find videos for I just searched in the help documentation and found exactly what I wanted.

A couple of bonus tips on items I recommend for study

  1. Make sure you know what all these words mean, and all the ways to use them!
    • inheritance
    • polymorphism
    • interface
    • abstract
    • extends
    • virtual
    • implements
  2. Understand all the relevant types of compliance standards (SAS, ISO, PCI, etc).

Taking the Exam

Don’t be shy about using the scratch paper they give you. You may have to calculate governor limits, sketch a rough ERD or flow chart, or use process of elimination by crossing things out.

I used 100 of the 120 minutes they gave me to complete the 60 questions. I just proceeded at a moderate and steady pace through the whole test without revisiting any of my answers. This strategy worked great this time, but on past exams I skipped questions I was unsure of and revisited them later. Once you have the rhythm of the test figured out, you aren’t as stressed about running out of time, and re-visiting seems unnecessary.

Study Guide is Great

There were some things in the study guide which weren’t on the exam, but if the exam questions are random, then perhaps someone else would those questions the next time.  Overall, I thought the study guide was a perfect tool for directing my study efforts.

Conclusion

If you have a true force.com understanding of 70% on the breadth and 60% of the depth you can probably pass this test with minimal study.  But the more you can study the better!  Cutting it close is stressful, and you never know what random questions you may get or any mistakes you might make.  Learn everything the right way over the years and it will sink in and most of the questions will feel like “freebies”!

Salesforce development struck by Lightning

One of the biggest bombs Benioff dropped (say that 5 time fast!) at Dreamforce 2014 this year was Salesforce1 Lightning:

salesforce1 lightning

 What theblue-lightning-hi is Lightning?

Not unlike the announcement of Salesforce1 at last year’s Dreamforce, Lightning has a lot of marketing hype and ambiguity.  This is due mostly to the fact it includes a suite of products.  However, also like Salesforce1, there is a piece of the offering that stands WAY out as the most important.  When all the dust settled around Salesforce1 it was the mobile experience that proved to be the real offering.  With Lightning it is going to be the new component framework, essentially the next generation of Visualforce, that is the real crown jewel.  The schema builder, process builder, and lightning connect are all awesome, don’t get me wrong, but they have been around in one form or another for awhile, and are just incremental innovation with rebranding.  The lightning app builder is also awesome, but it is just a tool for implementing the component framework in a WYSIWYG fashion.

New component framework?  What about Visualforce?

Well, what about S-Controls?  The one sure thing about technology is it is outdated as soon as it is released.  S-Controls made way for Visualforce.  Visualforce has had a long run in the life of force.com development, but is really starting to show its age.  In recent years ISVs and customers have had to deviate more and more from the strict Visualforce components to meet their requirements.  JavaScript frameworks have been creeping into Visualforce pages to the point where Visualforce tags are becoming a minority of the code in a page in many cases.  Controller extensions, viewstates, page refreshes and synchronous processing are victims of attrition.  They are being turned into museum pieces by more efficient user interfaces using JavaScript remoting, static methods, stateless behaviors, asynchronous processing.  Technically this is still a “Visualforce Page”.  But the composition of that page looks very different today then it did say 3 years ago.

Ok…  So, still why not keep using Visualforce?

Square Peg in a Round Hole_0565

In 2 words:  Mobile and Wearables.  Visualforce was designed for desktop computing with relatively fast, hard-wired network connections, large displays, and a full-fledged human interface devices.  Salesforce1 was a huge leap forward in addressing the needs of mobile computing.  But it left a gaping hole which developers had to attempt to fill as best they could.  Developing Visualforce for Salesfore1 is not an amazing experience.  Sure they threw us some bones like sforce.one.navigateToSObject.  But the architecture and styling just felt like a square peq in a round hole.  It doesn’t have that desktop Visualforce / Apex, Peanut Butter / Jelly meant to go together feeling.  Put another way, the Salesforce1 deficiency was the ability to create Salesforce1 mobile experiences in the same way salesforce created them “out of the box” on the Salesforce1 mobile app.

Salesforce1 Lightning to the rescue!

For sure the Visualforce pages of enterprises across the world will continue to be read and write data from and to the salesforce orgs they live in for years to come.  But no longer will Salesforce1 mobile app development have to feel like desktop shoehorned into mobile.  The beautiful, mobile, standard page layouts of Salesforce1 will flow more gracefully into custom Lightning apps.  <ui:button> will magically be the right button for Salesforce1 without needing to disguise <apex:commandButton> for the job.  Developers won’t be forced to go to other JavaScript frameworks every time they want to do something on the client side.  In a nutshell, Lightning allows us to go back to developing in a more streamlined “Visualforce-esque” manner, while still being able to leverage the latest technologies of the server and perhaps more importantly, the client.

Will the legacy desktop user interface go away?

I don’t know.  But there will definitely be new apps created with Lightning in a responsive fashion to work seamlessly across desktop, mobile, and wearable devices.  This is at least the start of a shift towards one UI to rule them all.  The {!$Browser.formFactor} global variable will let developers slightly customize their apps to work best on different devices.  One app customized for all platforms is much easier to maintain than a Visualforce desktop codebase and a Lightning Mobile / Wearable codebase.  The trick is doing it in a way where the experience isn’t compromised on any device.  This is hopefully where Salesforce will come in and handle the the lightning elements in different fashions depending on whether the Lightning app is run through the Salesforce1 mobile app on a smartphone, or through the desktop.  For example, a data grid that is smart enough to render differently for large vs. small screens without the developer having to handle that.  This also helps developers to “future proof” their code since salesforce provides an abstraction layer which they maintain so your app always works well on the latest devices.

Advice to other Developers

You need to have at least intermediate level JavaScript experience.  If you don’t have it, get it.  Read a book, take an online course, or just google your way through some complex JavaScript projects.  Don’t focus just on standard JavaScript syntax, but frameworks like jQuery, various patterns, CSS and the DOM as well.  JavaScript is going to become a KEY skill for salesforce developers (it already is in many cases).  This will not only improve your ability to crank out hybrid Visualforce pages, but it will also make the move to Lightning less of a shock.  It will also position you well to be create interesting new projects on Lightning vs. being stuck a role maintaining Visualforce…  And we all know building new things is more fun than maintenance.  🙂

Salesforce1 Lightning Resources

Adding Reports to Salesforce1 with jQuery Mobile and the Analytics API

Salesforce1 comes with nice dashboards built in, but no reports!

This is somewhat understandable.  Dashboards are already fairly mobile friendly while reports can be quite unwieldy, even on a desktop experience.  The number of rows and columns and the controls needed to manipulate them are not trivial to implement on a small touch screen.

It is, however, possible to attempt to build this functionality yourself with the Salesforce Analytics API and whatever User Interface you wish.

Arun Varadharajan, Product Manager for Salesforce Analytics has put out a nice, simple example of how to do this:

Check the link in the tweet to see his GitHub repo.

This example is cool because it uses no apex controller.  It is all done in VisualForce and JavaScript.  It renders with the Google Charts API, to make something that looks like this:

11

However the Google Charts API isn’t all that mobile friendly.  And this example provided no method for choosing which report to display.

I decided to look deeper to push this solution further ahead for the salesforce community.

My Contribution… sf1Reports!

sf1Reports uses the latest jQuery mobile framework to create a mobile-friendly report search and render experience.

The search uses JavaScript Remoting and SOSL to return the results as you type. It searches all your reports you have created in your salesforce org:

3

You can choose 2 modes to render the report.  Reflow or Column Toggle.

See these links for more info:
jQuery Mobile 1.3.2 Docs – Table Reflow
jQuery Mobile 1.3.2 Docs – Table Column Toggle

Reflow mode will look like a standard table when the columns fit on the screen, or will collapse the rows down into a block of label/value pairs when they don’t fit on the screen.  Reflow mode is good for looking at the report data one record at a time, but not as good for comparing the records to each other:
4

Column Toggle mode lets you select which columns you want to display, so you can fit the relevant columns onto your mobile screen:
5

Installation Instructions

Grab the files from my GitHub repo: https://github.com/danieljpeter/sf1reports .
Deploy the 2 classes and 1 VisualForce page to your salesforce org. I didn’t package them, but they are easy to deploy with something like the Force.com IDE.

Enable Salesforce1 in your org:
6

Make sure the mobile checkbox is checked on the VisualForce page:
7

Make a VisualForce tab for the page:
8

Add it to the mobile navigation:
9

Navigate to https://<your instance>.salesforce.com/apex/sf1reports by manually entering it in the URL bar.  It will change to your visualforce domain which will look something like this:
https://c.na15.visual.force.com/apex/sf1reports . Copy the visualforce domain portion of the URL as seen below.  You will need to paste it into the next step.

Take your visualforce domain, and add it to remote sites.  this is because we will be calling the rest API:
10

Final Notes

This is just v1.0.  It obviously is just a crude start, but it has potential.  Feel free to contribute to make it better.

It only supports tabular reports currently.  Summary and Matrix could be added with some more work.  I use the JSON Parser to blast through the Analytics API response.  That data is fairly complex, so I chose to iterate over the JSON rather than try to deserialize it.  There would need to be some thought as how to convert the JSON for Summary and Matrix reports to corresponding apex and ultimately HTML elements.

I chose a flat listing of all reports that is searchable by SOSL.  This seemed like a good mobile-first thing to do.  If desired, navigation through the report folders could be added.

It might make sense to make some mobile versions of reports in salesforce with a naming convention which have fewer columns and rows.

I noticed that the iOS Salesforce1 app would crash sometimes.  The Dreamforce 13 app also crashed in a similar manner, so I don’t know if it is a problem with my app or not.  Sf1reports didn’t crash which running it in a browser on my desktop with the /apex/sf1reports URL or the /one/one.app URL.  Hopefully Salesforce1 proves to be a reliable container for our custom VisualForce apps and this isn’t an indicator of a larger problem.

If you need report data on to go, it might just solve your needs!