Wednesday, November 29, 2017

Dreamforce Recap

Dreamforce 2017 was a blast.

Firstly, in spirit of Thanksgiving, I'd like to say thanks.

Thank You!

THANK YOU to the team at Salesforce for giving me the opportunity to speak again this year. THANK YOU MikeGillian, and Josh for your guidance during the event (on top of your other duties). Speaking at Dreamforce this year was challenging and fun. THANK YOU to my co-presenters, Jen and Norman for being kickass and inspiring. THANK YOU to attendees for your participation during our sessions. THANK YOU to my blog visitors for joining me today.

Now that everyone has been thanked, let's get to the recap.

My Sessions

This year, I had two presentations. You can watch these online:

The presentations went well, and were a great way to kick off the conference.

The Community

The best part about Dreamforce is meeting up with my friends and heroes in the community. I tried to squeeze in as many face-to-face meet-ups as possible, but four days is just not enough time to see everyone and attend everything at Dreamforce. I won't post all the photos here, but I tweeted most of my Dreamforce pictures. I loved attending the Appirio Reunion, 10K Party, Dreamfest concert, and Michael/ DOMO Cigar Party. The lunches and dinners that I went to between other gatherings were incredible. I loved seeing my friends at the 7Summits booth and making new friends with colleagues at the TCS cafe. Moving across the country has been a little hard for me. I don't fit in with the people in the SF Bay Area (yet?) but seeing my friends, colleagues, former colleagues, managers, and former managers in the Salesforce community was refreshing, inspiring, and uplifting. I'm so thankful for my #ohana.

Apart from being a source of encouragement, the Salesforce community has played such a significant role in my career and in the careers of my mentors, that we focus on it at the end of our Admin to Architect presentation. If you haven't attended a Salesforce conference or user group meetup yet, don't delay. Attend and make connections with others in this field. You'll make friends, grow your professional network, AND learn.

My Favorite Session

I think I died during the Meet the Developers session, which is a session that CTO Steven Tamm runs with lead architects to answer our questions about the platform roadmap... This was my favorite session because SOQL Christmas was announced --

Bad news: the session was either not recorded, or has not been posted yet. I'm not sure what else was promised because I blacked out after hearing the news about polymorphism.

My Favorite Keynotes, Other Sessions

Admin Keynote
Developer Keynote
Trailhead Keynote
Marc's Opening Keynote
True to the Core with Parker Harris (delivered and roadmap)

Several sessions have been posted online, both on Dreamforce site (scroll wayyyyy down to see different keynotes like Sales Cloud Keynote, Service Cloud Keynote, Marketing Cloud Keynote, etc.) and Salesforce Live (again, scroll down to the very low bottom of the page and expand the schedule to click on session titles).

Some friendlier session navigating is available for sessions posted on the Salesforce Developers Youtube account.

Taylor Swift

Yes, I'm putting a Taylor Swift subsection in my Dreamforce recap.

Taylor Swift's new album, Reputation, was released at the end of the fourth day of Dreamforce, Friday morning at midnight. It is sooooo good. Currently, my favorite song is either Delicate or Call It What You Want. This album will forever be the soundtrack to my 2017 Dreamforce memories. I love her. Maybe sometimes, I love her too much...

On that note, I'm convinced Adam totally won the Lip Sync Battle because he sang a Taylor Swift song. She is queen. (Also, he slayed at Tay and I hope this becomes a thing for next year!)

Final Thoughts

I'm so happy to have been able to attend Dreamforce as a speaker this year. Though there were no major product announcements at this year's Dreamforce, that won't stop me from dreaming about Polymorphism and Taylor's Reputation tour, which is lumped into my thoughts about Dreamforce.

Until next year!

Saturday, November 4, 2017

Deep Dive Into Negative Change Sets

"Shannon, I don't know what you just released to prod, but our CEO is calling me directly. Please fix it."


Ever wish you could just click a single button and undo a deployment? Well, you're in luck.

One of the topics I covered at Dreamforce with Norman Krishna during our "Where's the Undo Button" session was Negative Change Sets. 

Negative Change Sets are a declarative way to completely undo a release with a single button click. Why would you want to do this?

Let's say you deploy great items into production, but they somehow manage to negatively impact your users. Your immediate options are:

  1. Try to fix whatever you broke on the fly
  2. Revert back to a prior version of the functionality you created and remove the new functionality/items you deployed

As you can imagine, option #1 is super risky with no guarantee you'll be able to fix items. You'll also be in trouble with compliance if you're changing things directly in production, so you'll have to repeat the issue in a sandbox, fix it in the sandbox, and deploy your fix into production, which can take extra time.

With option #2, there is significantly less risk, but it may still take a while to revert because change sets take time to build and validate - especially if you have Apex in your org. You also need to make sure that anything touched in your deployment is reverted, which can be a time consuming and tedious task under pressure.

Enter Negative Change Sets. 

Instead of reverting in the moment, let's *plan* for our deployment to fail, and build our change sets before our deployment ever occurs. 

When you build and deploy a negative change set, you are reverting production back to the state it was in before your release. Ideally, your users will know no difference.

The idea is to build one or two change sets of the items that will undo your release, then quick deploy them if necessary. This means you won't have to scurry to fix things, then wait for the validation to occur. Planning to simply undo the release completely provides you more time to figure out what may have went wrong, and properly test any additional modifications in a sandbox.

Here are detailed instructions to build and deploy a negative change set. 

  1. Figure out what you intend to deploy to production in your next release. 
    • For our example, we intend to release a contact process builder change and an account page layout change, a new patient record object with several fields, and a new validation rule on opportunities
  2. Refresh a brand new, unused developer sandbox from production, call it "Negative Box" or something to denote this is where you will be building negative change sets
  3. Allow the new Negative Box sandbox to deploy changes to Production
  4. Create a brand new change set in Negative Box. Call it "Negative Box Revert" and add a release number or any other crucial details to the description to ensure everyone will know what this change set is -- a one-click undo button for the release.
  5. Add all Apex, Visualforce, Lightning Components, etc. to the Negative Box Revert change set
    • This ensures that if we make code changes during our next release, the code will be reverted back to a stable state, where we will achieve code coverage
    • If you have made code changes, check our Caveats section below.
  6. Add all of the existing items wherein you have changes or updates to the Negative Box Revert change set, which may include:
    • existing process builders
    • existing flows
    • existing workflow rules
    • existing fields
    • existing validation rules
    • existing approval processes
    • existing profiles
  7. For brand new functionality or objects, push them to Negative Box so you can use a change set from Negative Box to hide them with a single click
    • For our example, the brand new functionality and objects are the patient record object and our opportunity validation rule
    • We will bundle the patient record object and the opportunity validation rule into a change set, then deploy into Negative Box
  8. In Negative Box, remove brand new items from page layouts, modify the field level security to hide them, and remove permissions from profiles to revert - just like you would if you needed to hide/revert in production
    • For our example, we are hiding the patient record object from all profiles except System Administrator, and we are deactivating the new opportunity validation rule
  9. Bundle all new items into the Negative Box Revert change set. Include profiles, since you have likely hidden objects at the profile level as well.
    1. In our example, we include the opportunity validation rule and the patient record object, as well as all of our profiles
  10. Push the Negative Box Revert change set into production and validate
  11. Deploy the Negative Box Revert change set only as needed to revert.
  • Process Builders and Flows do not always automatically activate when updating or reverting an existing version. Ensure you check all versions to maintain the preferred active version.
  • For code changes, you should use the current Negative Box code versions to completely revert to existing production state. Then, bundle into the Negative Box Revert change set.
  • For brand new code, move the code into Negative Box but comment it out. Double check test classes to ensure they do not fail. Deactivate brand new triggers in Negative Box. Then, bundle into the Negative Box Revert change set.
  • If you have hidden new items or functionality during your Negative Change Set, you should return to the items or functionality in a patch release, OR completely delete them at a later date -- there is no need to keep broken, hidden items or functionality in your production instance

In conclusion, a little planning goes a long way. Let Negative Change Sets save your next deployment - before anything blows up. 

P.S. There are even cooler tricks to talk about regarding reversion. This post is meant for admins who are familiar with declarative functionality, but have never heard of source control. More to come, for sure!