Saturday, November 22, 2014

Learning Coding Skills May Be Easier Than You Think

Last week, I tried to convince you how easy the path can be from Salesforce Administrator to developer.  This week, I'd like to look at a couple of additional resources for the administrator who is beginning to dabble in code.

Don't be afraid to step out of your comfort zone and
try new skills.  You may be better than you think.
As I've mentioned before, Flow, or Visual Workflow, is a lot like a visual programming tool in the ways that it can be used to add complex functionality and alter the Salesforce user interface just by clicking on various programmatic elements.

But you can make Flows even more impactful by employing Visualforce as well.  With Visualforce, you can further customize the user interface and even incorporate HTML, CSS and JavaScript to provide more bells and whistles.

Visualforce also opens the door to more programmatic control over your Flow.  You can create more complex data interactions, such as referencing static resources, by adding an Apex controller to a Visualforce page that calls a Flow.  You can also use a custom Apex controller to specify a variable finish location for the Flow, for example finishing on a newly created record detail page.

I have written about this previously on my blog, here: http://www.snugsfbay.com/2014/04/salesforce-flow-using-record-ids-at.html

You might also be interested in watching a Dreamforce session I co-presented on this topic, which includes all the code you need to customize your Flow from start to finish, including the unit test: http://dreamforce.vidyard.com/watch/7mBX_EQGTTz8pmZeo0724A

Either way, I hope that you'll agree Flow is a great tool for administrators who are interested in expanding their skills and taking on more complex business problems.  And it provides a great stepping stone into learning to code in Visualforce and Apex as well.

Sunday, November 16, 2014

Salesforce Administrators May Be Developers Without Realizing It

The path from Salesforce Administrator to Developer is much easier than the path from developer to administrator, I have come to believe.  It is easier for administrators because it is a natural progression.  Administrators build skills starting with user management and data security and expand on these basics by building out customizations and user interface changes through native Salesforce clicks not code.  Administrators go from making use of solutions provided by Salesforce to making use of native tools to create custom solutions.

Being a Salesforce Administrator can be very enlightening
for anyone who wants to learn to develop code.
Developers take the opposite approach.  They go from developing their own solutions to trying to learn and keep up with solutions already provided by Salesforce.

If you are an administrator who has built custom fields and objects, you are well prepared for understanding programming concepts like data types.  A date time field is different from a number field, you know that already.  You may even know that you can use formulas to force fields of one data type to be evaluated as a different data type; for example, you can convert text to a Date field using the following:

DATEVALUE( "YYYY-MM-DD" )

For a developer, understanding the Salesforce data model is more complex.  Not only do they need to understand that fields are of a specific type, they need to understand how those fields relate to the data model as a whole, and that could involve native functionality like roll-up summary fields or complex data sharing rules and existing workflow rules that enforce specific, custom behaviors.

The adventurous administrator has a reasonable and natural path to growing their skills as a developer as well.  From developing custom fields, objects and user interfaces through page layouts, administrators can begin employing more complex tools.

With Flow, or Visual Workflow, an administrator can create complex user interface changes, including combining inputs for multiple objects on a single page (a master and child record, for example).  Flow also lets administrators run complex data consistency rules, enforcing best practices at a system level rather than expecting users to memorize and consistently act on arcane rules themselves.  Flow gives administrators a chance to manipulate the data behind the scenes in ways that previously may have required a trigger as well.

If you are interested in getting an introduction to Visual Flow, here is a Dreamforce session I co-presented that may help: http://dreamforce.vidyard.com/watch/dq8giCcDC8MIPiKYDRgTyg

Flow also provides an opportunity for administrators to expand their logical thinking skills.  Planning out the steps of a Flow and ways to test the Flow before making it available to users are skills that translate directly to planning out a program that you may want to code and finding ways to test it.

Next week, I will share some more tips on making the transition from Salesforce Administrator to developer.

Friday, October 31, 2014

Gamify Your Salesforce Implementations

Gamification has crept into the business world where companies seek to engage and reward their employees, customers and partners.  For the Salesforce administrator, gamification can also be a valuable tool.
Give users a way to power up!

For your next implementation, whether an implementation of a new application in an old org or an implementation of a brand new org, consider how gamifying the process can make things easier for users.

Any new business tool can seem overwhelming at first.  If there are too many options, users might have a difficult time mastering even basic skills initially.  This leads to user frustration and discourages them from using tools available to them.  But what if tools offered only the solution users needed at the point that they needed a new solution?

With gamification, individuals are rewarded for executing specific tasks that indicate their level of engagement.  In the world of video games, this means that players begin with easier tasks and limited resources and then build resources and skills to meet their next level of challenges in the game.  You don't start the game by battling Bowser in his castle with the racoon suit in Mario World, after all.

Salesforce users can benefit from the same approach.  If you limit users by giving them access to the most basic set of features initially, you can build their confidence with using Salesforce and build their interest.  When users gain access to new features, they can take the time to figure out how best to incorporate them into what they already know how to do.  And users will be happier if they can have new features after they begin to recognize a need for the feature in their day-to-day work.

To make the process work for you, the administrator, employ permission sets or create graduating levels of user profiles to add access to new features when you are ready for users to level-up.  It gives you the chance to roll out new training materials and focus support efforts in a staggered fashion as well.

With the gamify approach, as an administrator, you can focus on training users for specific skills over time.  You can train users in basic skills and provide support while building a base of power users for those basic skills.  When users are ready to move on to learning and implementing a new set of features and skills, you can spend your time training and supporting them while relying on your power users to continue to help anyone who is still struggling with earlier skills and features.

This process requires an administrator to know how features fit together and to
have an understanding of how users will implement Salesforce features.  If you build out your permission sets and profiles ahead of time, you can respond to any users who want to power through all the 'levels' at once and you might even be able to get their help writing up a 'game' guide for others.


Saturday, September 13, 2014

What It Means To Find Success

The San Francisco Bay Area has its share of famous people, and for the most part, San Franciscans could not care less.  So when I saw a familiar looking face near China Town, well, it could have been a famous person, but if it was, he was dressed like a panhandler.  He was entertaining a group of tourists on the corner.  That's not odd either, San Francisco has some entertaining buskers.

At home, I told my kids that I saw someone who was likely this famous person they would recognize.  One of them had time to go downtown with me to see.  'No,' my kid said, 'it's not him.'

But it didn't matter.  The guy had been entertaining tourists and we stopped to be entertained as well.  He told riddles and made us laugh.  He invited my kid to hang out with him any time when I took their picture together.  It was an enjoyable moment with someone we normally wouldn't be talking to, whether it was the famous person or the panhandler didn't matter.

Even though my kid said no, I still believed that it could have been the famous person in a bit of disguise, just hanging out.  Why would a famous person do that?  Why not?  It would be an opportunity to connect with people without particular regard for social status and money.

I went back a few days later for an autograph.  That's right.  I decided I didn't care one way or the other whether this was the famous person or the panhandler.  There are a lot of people who aren't famous at all who deserve to be treated like a star, and everyone feeling a little down-and-out can benefit from a bit of appreciation.  I wrote a note of thanks for entertaining us and spreading joy.  The message applied to either the star or the panhandler.  But I put some money in the card just for the panhandler.

I'm keeping the autographed picture for my kid.  I don't know what kind of success my kids might ultimately find, but I hope the photo reminds them that nothing of much importance separates the star from the panhandler.  And opportunities to connect with other people offer the best success any of us can find.

Now what does any of this have to do with Salesforce?  If you check out the community at success.salesforce.com and the power of us hub, you will see two online communities where people connect on business and technical topics, including offering each other professional and career tips.  It's a very friendly and supportive environment.  Salesforce clearly has invested resources into keeping the community strong and relevant and the opportunities to connect with other people truly offer all of us more chance of finding success.

Sunday, July 20, 2014

Living in a Bubble

I have been happy in my bubble, where women are prevalent in technical positions, leadership and as developers.

The bubble started when I was in college, completing a computer science major.  My graduating class had the most women completing the computer science major of any class the university saw from that point on, with 45 of us graduating that one year.  Just a few years later, the same university would see 0 women graduating with a computer science major.  Though numbers soon climbed again, they have yet to reach the same peak.  Similar universities have had similar number fluctuations.

Do you see this as disruptive technology or a necessity?
After graduation, I eventually wound up working in the world of nonprofits.  Look around there and you will see women running the show from the top down.  According to the 2013 GuideStar Nonprofit Compensation Report, there are more women than men who run mid-sized nonprofits.  The number of women in IT and database design and administration, at least in the Bay Area, appears to be high as well, from my personal experience.

In addition, women are hailed as early adopters in a lot of technical arenas. A social media study reported by BlogHer found that "Women have an appetite for the latest gadgets and apps," particularly ones that are useful or fun.

So I've been a bit surprised by all the talk about tech companies lacking diversity and failing to employ women in technical or leadership positions.

There is a view that strong teams contain like-minded people, and that may be true if all you want is a strong team, strong enough to plow forward with weak ideas.  But if you want strong ideas, you need to challenge your solutions by creating teams of diverse thinkers who are comfortable defending their ideas, listening to other points of view and adapting to come up with even better ideas.

Innovation springs from a diversity of thought and experience and leads to ideas that can disrupt industries or invent new ones. Remember, problems inspire creativity, so don't be afraid to expose your teams to a broader picture of the problems they set out to solve.

When elevators had able-bodied, human operators the controls were placed at about elbow-height.  The placement of the controls remained the same even after operators became obsolete.  But with a more diverse viewpoint, someone finally designed an elevator with controls at foot level as well as elbow level.  If you've ever entered an elevator with a cup of coffee in each hand or a large box of equipment, you might see the use of this feature for an even more diverse selection of elevator passengers including anyone who has trouble using their fingers for such tasks as pressing buttons.

We all need to leave our comfortable bubbles to learn new things, broaden our points of view and expand our knowledge so that we can develop stronger solutions with broader appeal.  That just doesn't happen very well without diversity.


Wednesday, July 16, 2014

Using Flow Rather than Apex: Performance Tests

Some of the newest Flow features allow for working with collections of records and using a single operation for adding those records to or retrieving them from the Salesforce datatbase.  In the past, Flow could only create or retrieve a single record at a time, but recent features give administrators a visual interface for creating powerful and automated solutions to their business problems using clicks-not-code.

Checking time required and limits for Flow.
As the capabilities of Flow converge with those of Apex programming, administrators will no doubt start handling some of the same tasks with Flow that previously required Apex.  Creating and updating records automatically is a great example of a task that administrators with no programming experience can now manage themselves, for multiple records at a time, with Flow and no Apex code.

But if you have a choice between two tools, it is interesting to see how they compare.  Flow is obviously easier than Apex for anyone not trained to code, while Apex is more flexible.

Benchmarking performance differences reveals the impact of using Flow to replace Apex.  I tested this by coming up with both a Flow and a bit of Apex code to create new records for a custom object and comparing their performance according to feedback from the developer console. 

Performance Comparison


To start, I created a simple bit of Apex code to add 1,000 records to a custom object.  The developer console tracked CPU usage as well as the number of database manipulation language (DML) statements, both of which are performance concerns for anyone watching their governor limits.

I then replicated the code using Flow to add a large number of records to my custom object so that I could compare the performance relative to those same governor limits.  Thanks to the collection variable available with Summer '14, I was able to create a Flow that managed a single DML statement for multiple record insert operations using a Fast Create element.  Previously, this would require a single Record Create element for each new record and so the number of DML statements could become excessive and slow without these new features.

Unfortunately, Flow was more restrictive on the number of records I could manipulate with both the collection variable and the Fast Create element.

For the collection variable, I found that I was only able to hold 499 records with a single variable.  Apex is not so limited with lists and arrays.  This limit meant that I could not create as many records with Flow as I could with Apex.

For the Fast Create element, I was even further limted by Flow.  With Apex, up to 200 records can be insterted with a single DML statement and more records can be submitted with insert operation.  Salesforce automatically divides the operation into multiple statements for blocks of up to 200 records.  For example, 201 records result in 2 DML statements according to the debug console.  My Flow got stuck at 200 records, I could not use the Fast Create when my collection contained more.  Even with 200 records, the debug console reported 2 DML statements being executed for the Flow.

Having to reduce my test size meant that neither the Apex nor the Flow had any measurable use of CPU time.  I look forward to being able to insert more records to better compare performance.

One of the Salesforce critical update messages suggests that enabling governor limits for Flows will have an impact on performance.  You should test your Flows with this update enabled before it goes into effect by default in 2015.

Sunday, July 13, 2014

Leveraging List Views With Salesforce1

The good thing about Salesforce1 is that you have to rethink your user experience and data access for mobile.  Yes, I said good thing because rethinking data access with the mobile user in mind will result in a better user experience for someone on the road than shoehorning everything from the desktop onto a more limited device would.  With Salesforce1, you can provide mobile users with access to data specific to their needs while on the road thanks to Flexipages.

Try something different just for mobile users.
A local nonprofit where I occasionally do volunteer Salesforce development work wanted a mobile app to provide users with quick access to specific groups of records.  These users need to update about 200 or more records a day using a mobile device.  And they want some flexibility regarding the order in which these records might be accessed.

My first thought was to create Visualforce pages that would offer specific groupings of records, but the nonprofit really needed something more flexible.

So I turned to Flexipages to solve the problem.  With Flexipages, you can design a mobile-specific interface that relies on List Views to provide access to specific groups of data.

At their most basic, Flexipages simply define which List Views for a specific object should be incorporated into the mobile experience, including the Recent Items list.  If you can create a List View that prioritizes Accounts Needing Attention, for example, the mobile user can bypass the Accounts Tab and just access that list with a Flexipage.

But Flexipages don't merely offer a single List View, they can combine multiple List Views and Global Actions all in the same screen.  So a Flexipage might offer access to Accounts Needing Attention and Currently Discounted Products all with a single navigation graphic, in addition to a Global Action for creating a New Contact.

In crafting a mobile experience for your users, consider creating Flexipages and putting them at the top of the navigation menu, above the standard tab navigation options like Account and Contact Tabs.  This gives  users more immediate access to specific records of interest to users on the go.

For the nonprofit, I created several new List Views to combine different records on the same page.  I also added an image formula to signify which records had been updated on the road to help the user easily determine which records still needed attention.  You can read more about using images with Flexipages in a recent post.  I also created about 10 different Flexipages to provide the most flexible access to all the records they update via mobile.

Flexipages are easy to create as text files outside of Salesforce.  They are XML files, which are simply text files with specific textual "tags" enclosed in triangular brackets.  For example, "<description>" is a beginning tag and "</description>" as an ending tag, while the text between these two tags would be the actual description.

Once you create a Flexipage, the easy option for deploying them, currently, requires placing them in a zip file with a particular directory structure and naming convention, and including a second XML file listing which Flexipages to deploy.  The zip file can be deployed with Salesforce Workbench using Migration>Deploy.

For more information about creating Flexipages, refer to the documentation here: http://www.salesforce.com/us/developer/docs/api_meta/Content/meta_flexipage.htm

Once you consider which data is the highest priority for mobile users, simple List Views, combined with Flexipages, provide the view your mobile user needs to the data they most want.