Need Help Converting Your Classic JavaScript Buttons to Quick Actions?

In last weeks Lightning Keynote for TrailheaDX, Eric Jacobsen told everyone that an analysis done by his group showed that there are over 2 Million Javascript buttons in Salesforce Classic today.

WOW!!! That’s a lot of buttons that still need to be converted to Lightning Quick Actions.

This has been a not so fun task lingering over many Salesforce developer heads for quite some time. I imagine this one issue has been the main reason many Salesforce orgs have been hesitant to fully adopt Lightning.

So now my question to you is, “Do you think you need help converting your JavaScript buttons to Quick Actions?”

If you answered yes, then the good news is that the help is coming. Eric announced in that very same keynote that a new tool called the Lightning Configuration Converter will be available in late Spring 18.

The new tool will help you to identify those JS buttons that you still need to convert and then for some of them, will give you a simple way to convert them by using a single click. Yep! A single click!!!

Screen Shot 2018-04-08 at 5.15.28 PM

So that was the good news and now here is the bad news.  The bad news is that the tool is not quite available yet and even when it is, they are estimating that it will only convert about 20% of your buttons at first. But, it sounds like that number will possibly go up as time goes on. And let’s face it, 20% is still a lot better than 0%. So, I still think this a huge win for the Salesforce development community.

And here is some more good news. Right now what is available is a GitHub repo that contains 9 examples of commonly used JavaScript buttons and the code needed to convert those to Lightning Quick Actions. This covers some of the most common and sometimes complex scenarios where JS buttons are used, such as:

  • Showing a Dialogue
  • Redirecting to a URL conditionally
  • Performing Mass Updates

So check out the repo and wait for more news about the release of the new Lightning Configuration Converter.

Happy Converting…

Come Check out Managing Application State with SPA’s at TDX18

I am very honored to be participating as a panelist asking questions about Managing Application State with SPA’s. The session will be on Thursday, March 29, 2018 from 1-3:00 pm and is titled, “The Extracurricular: “Why Did That Do That?” Managing Application State w/ SPAs”.

It is a really cool format and one I think will be very fun and interactive (with lots of audience participation), so if you have any interest in this topic, I highly encourage you to attend. The main speaker is the incredible Matt Lacey and he will be talking about the challenges he has faced building a Visualforce application that used VF Remoting and React + Redux to manage application state.

The best part of this is it is not just your typical session in which the speaker just tells you a bunch of stuff and shows a bunch of boring slides. Not, this one is special. It will involve Matt briefly telling and showing us his app and then the rest of the time will be a very interactive discussion about managing application state that will involve not only the panelists and myself, but you the audience member as well. How super cool is that?

Ok, so if you are going to TDX18 and have some time on Thursday, please stop by.

And also be sure to check out Camp Quick Start  (that is where I will be most of the time), as well as the new and incredibly fun Robotics Ridge.

See you there…

Goodbye Force.com IDE Beta…Hello Visual Studio Code

Back in 2016, I wrote a post here about how the Force.com IDE was making an epic comeback, with support for Lightning.  At the time I was very excited to see that Salesforce was refocusing it’s efforts towards improving that tool in the form of a Beta. Even though the Force.com IDE was the original tool that Salesforce offered and it had a long history with the development community, it had failed to keep up with the bevy of tools now being offered by third-parties.

Fast forward to today and the recent announcement by Salesforce that the Force.com IDE Beta has been officially discontinued.

So where does that leave Salesforce developers?

Well, not as bad as you might think. Salesforce is not giving up on supporting a local IDE. Nor are they giving up on the original version of the Force.com IDE (at least not just yet). So far, only the new Beta will be discontinued.

It is just that they are focusing their efforts towards improvement of the Salesforce Extensions for Visual Studio (VS) Code. It just made no sense to support two tools and after analyzing feedback from the Beta of the Force.com IDE, the team had to make a clear choice and Salesforce Extensions for VS Code came up the winner.

I personally prefer Visual Studio Code and there is no question that it is easier to install than Eclipse (which was always a bit of a nightmare imho with all the required Java installs it required). I also like how intuitive it is and that I can use it to do all sorts of other modern development. If there is a popular modern language out there, you can safely bet that VS Code supports it.

If you have not had a chance to check it out yet, I highly suggest you do so and just remember to keep an open mind.

Also, be aware that Salesforce Extensions for VS Code does not yet support everything that the Force.com IDE does. Like I said earlier, the original Force.com IDE is not going away, just the newer Beta version which included support for Salesforce DX and Lightning. It is going to take some time for the development team to get all the features that the Force.com IDE offers into Salesforce Extensions for VS Code.

But keep in mind, that VS Code is where they are headed, so if you have not yet checked out Visual Studio Code, now is the perfect time to do so. I think you will be pleasantly surprised and impressed with it.

And let me know what you think…

New Dream Job at Salesforce

THLogoI have very exciting news to share. The first day of Dreamforce will also be my first day as a member of the Trailhead team. I have accepted a job as a Technical Curriculum Engineer.

Doesn’t that just sound cool?

And the best part is that I will be working for the legendary, Jeff Douglas!!! Yep, that guy. The one and only. I bet you are way jealous now.

The thing that I love so much about Trailhead is the quality of the content they produce. I truly believe they are leading the way in terms of how to produce effective technical instructional material and I am just thrilled to be a part of it.

The thing I am most passionate about in life is the process of taking something that is very complex and difficult and presenting it in a way that is easily understandable to almost anyone. It is kind of like the ultimate crossword puzzle (and yes, I happen to love crossword puzzles).

As far as this blog and my courses at Pluralsight, we will have to see how that goes. I still have my latest course about Lightning Best Practices coming out soon (since I am almost finished with it). But after that is published, I may take a break for a while so I can really focus on my new and exciting job.

Cheers everyone,

Sara

 

Why Lightning Base Components are so Awesome

When Lightning development was first introduced, the Salesforce developers thought UI components (which you have probably seen used in a lot of sample code) would meet all the needs of component developers. They were wrong. Although the UI components, which include things like ui:inputText/ui:outputText, ui:button, ui:menu, ui:message are very useful, they have some serious drawbacks.

The biggest drawback is that they do not handle validation for you automatically. The component developer is responsible for adding JavaScript code needed to validate data entered into these components. Another big drawback with UI components is that they do not handle Salesforce Lightning Design System (SLDS) styling for you. You have to know which SLDS tags to use around your UI components.

To understand exactly what this means, consider a “very simple” component used only for creating new cases. This is what the component looks like when rendered:

Screen Shot 2017-03-03 at 2.51.39 PM.png

Using UI components, this is how much code is needed to validate this very simple component:

validateForm: function(component) {
  var validCase = true;
  var subjectField = component.find("Subject");
  if($A.util.isEmpty(subjectField.get("v.value"))) {
     validCase = false;
     subjectField.set("v.errors", [{message:"Subject can't be blank"}]);
   }
   else {
     subjectField.set("v.errors", null);
   }
   var reqNumberField = component.find("EngineeringReqNumber");
   if($A.util.isEmpty(reqNumberField.get("v.value"))) {
     validCase = false;
     reqNumberField.set("v.errors", [{message:"EngineeringReqNumber can't be blank"}]);
   }
   else {
     reqNumberField.set("v.errors", null);
   }
  // Verify we have a contact to attach it to
   var contact = component.get("v.contact");
   if($A.util.isEmpty(contact)) {
     validCase = false;
     console.log("Quick action context doesn't have a valid contact.");
   }
   return(validCase);
 }

In addition to having to add your own validation code to the JavaScript controller, you will have to know which SLDS (or Salesforce Lightning Design System) tags to use and this is not always so obvious.

Most developers I know do not want to have to spend the time learning which CSS tags to apply to get the styling they need. They just want things to work. Out of the box. Simple like.

I hear ya and so did the developers at Salesforce.

In Winter 17, Salesforce released a whole new set of components known as Base Lightning Components. Similar to the UI components, these components do something fundamentally different. The validation code and SLDS styling is built right in. All you have to do is add the markup to your page and waaaalaaa!

The page will render the same with styling and will have built-in validation, but the code will be so much simpler.

If you have not checked out the Base Lightning Components, you might also want to check out my new course on Pluralsight, which has an entire module about Base Lightning Components.

Top 5 Lightning Tips for Visualforce Devs

#1- Transition does not have to be all or nothing

For Visualforce Developers, when it comes to transitioning to Lightning development, it does not have to be an all or nothing deal. Very few development shops/companies will go from doing all Visualforce development to doing all Lightning development overnight. That is just not realistic, nor a good idea, in my opinion.

The introduction of Lightning Out offered a lot of options for Visualforce developers wanting to slowly transition to Lightning. If you want to learn what options are available in terms of a transition plan, I suggest checking out this post and blog series by Salesforce Architect, Mike Topalovich. Mike does an excellent job, not only of giving a lot of background, but of detailing 5 specific migration paths that you will want to consider.

#2 – Watch your Casing

JavaScript is Case sensitive!!!

This is so important, I am going to write it again, “JAVASCRIPT IS CASE SENSITIVE”.

If only I had a nickle for every time I ended up discovering that the odd error I was getting in Lightning was actually caused by a casing error of mine. Seriously, I cannot tell you how many times this has tripped me up. More times than I would probably like to admit.

So anytime you are working with Lightning and you get an error that makes no sense, the first thing you should do is return to your JavaScript code and make sure you did not make a casing error. It really is VERY easy to do. Embarrassingly so.

#3- Security Works Differently

As Visualforce developers, you have been spoiled as far as security is concerned. Visualforce apps operate out of the Force.com domain, which is not shared with Salesforce code. But, Lightning apps and components run in a special domain that is shared with Salesforce-authored Lightning code.

This means that the security for Lightning components are subject to a Content Security Policy (CSP). The rules surrounding what is and what is not allowed with these components will just tighten as time goes on. Go here to learn more about all the concerns regarding Lightning Security.

One important thing that you need to know is that any of your AuraEnabled Apex classes must do an explicit check for CRUD and FLS permissions. This was handled automatically for you in Visualforce pages, but in Lightning, unless you are using the new Lightning Data Service, you will need to do this check manually. You can do so using the isAccessible(), isCreateable(), isDeleteable(), and isUpdateable() methods. You can learn more about how this is done here.

#4 – Install and Use the Lightning Inspector

For Chrome users, there is an excellent plug-in called Lightning Inspector that every Lightning developer should check out. One of the most useful features it offers is a component tree tab, which shows you how the Lightning Framework sees your component. You can use this as a tool not only for debugging components, but learning more about what some of the built-in ones are capable of.

#5 – Check out newest components/features added

The Lightning Framework has been out for a while now (over 2 years actually) and in that time there have been many new releases and lots of new features added. Building Lightning components today is not the same as it was when you may have run through a tutorial or article a year or two ago. If it has been a while since you took a look at what features and components are available, it is time to take another look.

In the last release (Winter 17) many new features were added such as the Lightning Data Service, which you can kind of think of as the equivalent of a Standard Controller for a Visualforce page. Currently this feature is still in developer preview, but using it allows you to eliminate the need for Apex code and also those manual security checks that I mentioned earlier.

I strongly believe that component-based development, such as what you do with the Lightning Framework is the future of web and device-based development. If you have not already dipped your toes in Lightning Development, it is not too late. Things are just getting really good for this modern development platform.

AI for Everyone? Kind of

Recently, Salesforce started a campaign concerning their latest product offering, Einstein. This einsteinplane1campaign promises, “AI for Everyone”.

That is quite a claim and Salesforce is certainly not the first to make it. As a self-proclaimed AI Enthusiast/junkie, I can say that I have seen this type of claim before. However, this is the first time that I think it might actually be somewhat possible. At least as far as a specific area of AI known as deep learning is concerned. And, also if were talking about relating this just to Salesforce in particular.

So, does this mean that soon everyone will have personal robot butlers?

Absolutely not. We are not even beginning to talk about robotics here. Nor some other areas that fall under the rather large AI umbrella.

So what can Salesforce customers do with Einstein?

Well that will certainly change as the product evolves, but right now the most relevant thing you can do with it is to utilize the Predictive Vision Service (PVS). This can be used to classify images into categories using supervised learning and very specifically optimized machine learning algorithms. These algorithms were developed by a company called MetaMind, which was last year aquired by Salesforce and since then they have been working feverishly to offer their services on the Force.com platform.

If you are interested in learning more about how this works, check out the docs here or this recently released webinar, which does a very good job of laying out what is currently possible with the PVS.

Note that currently Salesforce is not offering a service that does Natural Language Processing (NLP).  But, I am sure that will be the next big thing Salesforce customers will be demanding. NLP is a huge field and one that has been around for many years, but with varying levels of success.  The most difficult challenge I suspect will come from the fact that the product will need to support several languages beyond English to be considered useful. It will also need to be able to handle untrained users with a high degree of accuracy, which is a very tall order to fill.

It appears to me that the majority of Einstein’s capabilities will be “Baked in” to many of Salesforce’s products and their use should be seamless to users. They will also be very specific to Salesforce CRM.

The most important thing to understand is that Einstein is NOT a general purpose AI engine. As enthusiastic as the Salesforce Marketing team obviously is, Salesforce has not reinvented the wheel and certainly not developed some new and unheard form of AI that will corner the market.

BUT, they have started to offer some very useful API’s that can be used to implement specific areas of AI that were once only accessible to the elite of AI researchers.

And the most promising news was just announced this month when a group from Salesforce Research created a neural network named the Dynamic Coattention Network and that model was the first to break the 80% mark when tested against the Stanford Question Answering Dataset. And for those of you that just said to yourselves, “and why should I care about that?”.

Well, ever since Stanford released their dataset, which now consists of questions posed by crowdworkers on a set of Wikipedia articles, lots of top AI researchers (including Microsoft, Google and IBM) have been racing to create models that will reach this golden threshold, but Salesforce was the first to reach it. It’s kind of a big deal.

I look forward to the next few years and seeing all the new services that will be added to the platform, bringing about the Enhanced Computing world I always envisioned.

Winter 17: Replacing JavaScript Buttons With Lightning Actions

Winter 17 hasJS introduced a whole bunch of new enhancements for Lightning and I will be blogging about a lot of them in the next few weeks, but one of my favorites is the new Lightning Actions that provide the ability to replace all those JavaScript buttons you may have littered about your org.

Ok, now anyone that has an org with more than one JavaScript button, just read that last statementdreamstime_xl_25648715 and probably thought, “Say what? I have to replace JavaScript buttons with something new? What about just migrating the existing buttons to Lightning?”

Can’t do it.

Why? Well, in three words, “Big Security Concerns

Yep. the kind that can bring an org to it’s knees and one that also can’t be resolved by providing some simple migration tool that converts existing buttons into Lightning actions automagically.

The bad news here is that you are going to have to do some real work to get all those buttons converted into Lightning actions. But, the good news is that once you do it, you will probably be very happy that you did and your org will certainly be more secure as a result.

And to help you get to that point, the Salesforce development group has started a new blog series titled, “JavaScript Buttons, Lightning and You“. This three part series will step you through what you need to know to move towards Lightning Actions. I also plan to cover this very topic as part of the new Lightning course I am working on (more on that later).

So, take some time to check out the new blog series and learn why you might be better off starting your transition to Lightning by first converting all those buttons to actions.

And stay tuned for more info about my upcoming Pluralsight course.

 

The Next Generation of Programmers, Listen Up!

Want to know what you need to know to be ahead of the curve in the world of Software Development?

Look no further than the following YouTube video, which was recorded during last years Dreamforce. It was a talk about “Modern Architectures: Above the Platform, Beyond the App” and it details all the things YOU (the next generation of programmer) needs to know to be successful in the new generation of app development.

Unfortunately, as of today, it has only been viewed 145 times and yet should have been PeterCoffeeSalesforceDotCom_sq300-269x200viewed 145 million times. In this video, Peter Coffee, the VP of Strategic Research at Salesforce is going to give you a message that you really need to hear.

I hope you take the time out of your day to hear his message. It is a VERY important one. Make sure you make it to the 26 minute mark when he says that, “We need to go further and provide an experience y recomposing what we used to call apps. We need to write code that intuits desire from behaviour, learns history and applies it predictively…”

 

 

 

Apply .NET Skills to Salesforce

NETTrailReleased yesterday is a new trail titled, “Apply .NET Skills to Salesforce” and it is all about wooing more .NET developers to the Salesforce platform, which I am of course, all for.

This FREE and most excellent resource is written by a .NET developer for .NET developers. It does not sugar coat anything about the platform, but instead tells .NET developers honestly and directly what the platform offers and how their existing .NET skills can allow them to transition easily to Force.com. It also points out a lot of the common pitfalls they will want to avoid to be successful on the platform.

It consists of two modules. The first is all about SOQL and database basics and it has the following 4 units:

  • Moving from SQL to SOQL
  • Writing SOSL queries
  • Writing Efficient Queries
  • Manipulating Records with DML

The second module (which is my absolute favorite), it all about Apex and the Force.com platform and it has the following units:

  • Mapping .NET concepts to Force.com
  • Understanding Execution Context
  • Using Asynchronous Apex
  • Debugging and Running Diagnostics

I hope you check them out, as well as the Salesforce platform, which is growing more impressive by the day. And please let me know what you think.