Add Audio/Video Conferencing to Any Visualforce Page with GoInstant

GoInstantlogo-174x174It is very likely you missed the announcement less than two years ago about Salesforce acquiring a Canadian-based company named GoInstant. It is also likely that even if you attended Dreamforce in late 2013, you missed a very informative session titled, “Build Real-time Multi-User Apps with Visualforce, GoInstant and AngularJS“.

From what I can tell, not much fuss has been made so far about the Backend-as-a-Service provider that was founded in 2010 and acquired by Salesforce in 2012. I imagine that is mostly because up until a few weeks ago, there was not much you could do with GoInstant, other than add chatting capabilities (Hello, Salesforce already has Chatter).  But, with the recent integration with WebRTC (or Web Real-Time Communication), we may be seeing a lot more possibilities popping up.

GoInstant recently released a WebRTC-based widget that lets you EASILY add Audio/Video conferencing capabilities to any Visualforce page. No back-end servers required! And, it is completely free for the first 1000 monthly active users!!!

GoInstant handles all the complexities involved with offering this type of functionality. They handle security, data synchronization and storage, and even scalability. The WebRTC widget specifically lets you initiate, pause, and mute a video stream, all with a single click. And no need for the client to download anything (YEAH). It’s kind of like being able to offer the ease and power of Skype within a secure Salesforce connection.

webrtc-plus-goinstantI can see this type of functionality being really useful for customer support situations, but I can also see it being heavily used in the Enterprise for internal communications. Now, even small to medium companies can offer the type of audio/video chatting once only available to the really BIG enterprises. In fact, I imagine, even the big Enterprises will want to consider dumping their expensive and hard to maintain Unified Communications systems for something like this.

One Gotcha to consider is that currently, WebRTC is only supported in the latest versions of Firefox and Chrome (but I expect the list of supported browsers to be growing very soon). Another thing to consider is that there has still been no final decision made about what standard video codec will be used. (but again, I am sure this will be resolved soon enough).

If you want to see how this works right away, check out this demo created by the clever folks at GoInstant. And, if you want to start playing with this type of functionality in your developer org, I would recommend you check out this GREAT post on Developer Force about how to use the widget in a Visualforce page.

Training Review: Force.com Training on Pluralsight.com

Anyone that reads my blog knows that I am big fan (and regular subscriber) of the Pluralsight training videos. I cannot imagine staying up to date as a programmer without them. At this time, there are only a limited number of courses that cover the Force.com platform (8 to be exact), but I expect new titles will be added very soon. logo-v4

I really think that viewing these courses can be beneficial to anyone studying for the basic or advanced developer certification, or just people working with the Salesforce.com platform in general. These courses can also be valuable to developers (of any platform) that want to determine whether learning more about the Force.com platform is beneficial to them.

Pluralsight offers a free trial that allows you to view 10 days and up to 200 minutes of training. That would allow you to view for free at least one, but maybe two of the courses I describe in this post. Below, I will summarize which courses you should view, depending on where you are coming from and what you are trying to achieve.

First of all, if you only have time to watch one of these courses, I would watch this one:

Force.com Platform: The Big Picture by Don Robins – This is a high-level course that would be very useful for someone brand new to the platform. It is short (1 hours and 24 minutes) and would also be of great interest to experienced developers that have not worked with the platform for long. Robins includes a lot of history about Salesforce and does an excellent job of describing the “Perspective Shift” that is necessary for developers that want to be successful on the platform.

If you are studying for the First-Level Salesforce Developer Exam, I recommend viewing the following course:

Force.com For Developers by Richard Seroter – This is the longest course in the series (5 hours and 47 minutes), but it is also the most thorough. It provides a good overview of the entire platform in a very clear and easy to understand way. Seroter covers many topics that are covered on the 401 Dev exams, such as Reports, Workflows and Approval Processes. He also covers topics on the 501 Advanced Developer Exams, so this course would be good for people studying for that exam as well.

If you are studying for the Second-Level Salesforce Advanced Developer Exam, I recommend viewing the following courses:

Force.com Design Patterns – Part 1 by Adam Purkiss – This course is definitely not for beginners or anyone new to the platform. Purkiss talks about advanced topics such as the use of wrapper classes to get around some of the inherent limitations of SOQL. Some of the code walk-throughs were unpolished and appeared to have not been practiced in advance, but the beginning of each section was very good. My favorite section was the one on Trigger Design Patterns.

Force.com Design Patterns – Part 2 by Adam Purkiss – This course has three distinct segments and I can see the first two (Test Design Patterns and VisualForce Architecture) being especially valuable to anyone pursuing the Advanced Developer Certification. I actually enjoyed this course more than the preceding Part 1, because the examples were more general and the author did not have to waste a lot of time describing how the sample application worked. Purkiss includes many best practices that if you follow will ensure that your code stands the test of time. I really enjoyed the section on how to use Knockout.js to do JavaScript Remoting to create an HTML page that saved custom settings directly to Apex.

Introduction to Visualforce by Matt Lacey – This was my least favorite course, mostly because the speaker had a heavy accent that was hard to understand. He also rushed through the content and the general audio quality of the video was bad. However, the course did provide useful content that would be relevant to anyone studying for the Advanced Developer exam.

If you are an Experienced Software Developer that wants to understand more about the Force.com platform, I recommend viewing the following courses:

Force.com for .NET Developers by Dan Appleman – This course does a very good job of describing the Force.com fundamentals in way that makes sense to .NET developers specifically. Appleman is an experienced author who spent many years creating content for the .NET community, but a few years ago he switched (almost primarily) to working with the Force.com platform. Like myself, Appleman does not dismiss the .NET platform and certainly sees it as still viable, but he also can see the alluring reasons to understand the Force.com platform as well.

Force.com and Apex Fundamentals for Developers by Dan Appleman – Unlike the last course that was specifically designed for .NET developers, this course was designed for developers coming from any platform. It is not a course for people new to programming, but attempts to give experienced software developers a head start to writing “GOOD” code on the Force.com platform. Appleman will tell you about best practices and describe real-world scenarios that only come from hard-earned experience. Most importantly, he covers why design patterns used in other languages do not always apply in Force.com. He focuses on the 4 most important concepts (Execution Context, Use of Static Variables, Limits and Bulk Patterns) that you need to know to start working safely and efficiently in Force.com.

Patterns of Cloud Integration by Richard Seroter – This is NOT a course specifically about Force.com and instead focuses on many technologies that can be used to accomplish integration with cloud applications (on any platform, Force.com included). This course would be of great interest to any technical architects that need to understand to complexities involved with integrating cloud-based applications. Seroter is no doubt an expert in this field and he covers a variety of tools and platforms (such as Biz Talk Server, Windows Azure Service Bus, Mule Cloud Hub and custom code using .NET, node.js, Java, etc) used to integrate Ground to Cloud, Cloud to Cloud, or Cloud to Ground scenarios.

Book Review: Visualforce Development Cookbook

Not a book for beginners, but GREAT for seasoned Apex developers

I recently had the honor of reviewing the recently published, Visualforce Development Cookbook. The code recipes are great and could really go far in demonstrating the potential of the platform. It is obvious that the author, Keir Bowden has implemented many, if not all of these recipes in real-world scenarios. However, I think this is a dangerous book for developers new to the Force.com platform. In fact, I would not recommend it to anyone who has not worked with the platform for at least one year.

While step by step instructions are provided, along with occasional notes about real-world considerations that should be made, the author does not go into detail about these considerations. For example, on page 36, the author advises readers to use a Utility class to handle creating the data, but does not go into how to actually do this.

Also, the author only provides test code for one of the recipes in the first chapter and then never mentions testing again. Anyone that has worked with the platform for a while knows that writing test code can sometimes take longer and be more difficult than writing the actual code. I could see someone new to the platform using this book to create many changes in their development org and get everyone excited about using the stuff and then never be able to get all the required unit test code together in order to deploy.

The sample code that was provided was easy to download and well organized. It was also formatted properly so that you could cut and paste it straight into your development org. Very little sample code is included in the actual book, which I think helps to ensure that the book stays up to date. As long as the publisher and author continue to update the sample code with each new Salesforce release, the code should stay viable as the platform inevitably changes.

I REALLY liked the chapters on JavaScript, Force.com Sites and Mobile Development and cannot wait to try out some of the recipes included for my clients. My favorite part of the whole book was the fact that the author utilized the Google Hosted Libraries Content Delivery Network rather than static resources for the jQuery code. This was a very smart move and helps to ensure that the code stays viable in the future and also makes use of the latest industry standards.

Some of my favorite Javascript recipes included the tooltips (which featured a slick slidedown effect), the collapsible list elements and the scrolling news ticker. This chapter really demonstrated to me the power of Visualforce and how you can use it to make some powerful and dynamic pages that are unique to your brand.

I really appreciated the final chapter on jQuery Mobile. In fact, if you read only one chapter in this book, read this one. As the author explains, the book is about Visualforce and not mobile development, so it focuses on using HTML5 and the jQuery Mobile Framework to provide the interface code. My favorite recipe in this chapter was the one on navigation and transitions. The author includes transition examples that pop, flip, turn, flow and slide the user from one page to the next. Sweet!!! I will warn you that the code did not display well on my iPhone, but I plan on looking into this further and if I find out the reason why, I will do a separate post about this.

I did find a few inevitable errors in the book as I worked through the code recipes, but the errors were minor and I got past most of them easily. I will report the ones I found to the publisher as errata.

In short, this is an invaluable resource for seasoned Force.com developers, but should be approached with caution for newbies. Force.com is a powerful platform. Much more powerful than most people give it credit for. While this book does include recipes that clearly demonstrate that power, I think experience is needed to help the reader apply the knowledge from this book in the best way possible.

Custom Components Not Rendering Properly

After much searching, I have finally figured out what was causing two frustrating issues I have run into several times and thought I would share it with everyone. Both issues involve creating a Custom Component that includes HTML.

If you use an iframe tag to reference an existing Visualforce page and do not include a certain switch in your URL, the component will not be rendered properly and instead of seeing the rendered Visualforce page, you will just see code in the area where your custom component should be (see top left home component of image below)

CustomComponentsShot1

To avoid this issue, you must add a parameter to the url attribute for your iframe tag. For example, the component titled, Case Count By Status was referencing a Visualforce page named CasesSidebar using an iframe tag. Instead of using src attribute that looks like the following:

src="/apex/CasesSidebar"

you will need to include a switch after the page name called isdtp. The src attribute should instead look like the following:

src="/apex/CasesSidebar?isdtp=lt"

A second issue involves how you enter the HTML for your custom component. If you are not careful about how the HTML is entered, your component will end up displaying the actual HTML code and not the rendered result. For example, if you were to add a Custom Component to the Home page by going to Setup | Customize | Home | Home Page Components and clicking New, you will be brought to a page that looks like the following:

CustomComponentsShot2

If you were to start entering HTML code into the editor below and THEN click Show HTML, you will have a problem when the component renders. Instead of displaying the rendered iframe, you will just see the iframe HTML where your component should be.CustomComponentsShot3

You MUST click the Show HTML checkbox BEFORE you type or paste any code into the editor area. I personally think this is a bug and it should not matter when you click the Show HTML checkbox, as long as you do so before clicking Save.

Perhaps Salesforce will fix this at some point in the future, but in the meantime, I wanted to post this and hopefully it will be found by someone encountering the same issue.

Proper Use of ActionStatus component

In preparation for the Advanced Developer exam, I have been painstakingly going page by page through the Visualforce Developers Guide (which can be found online here). Almost every single person that has passed the exam has suggested that you become intimate with this document, but I wonder how many people truly are. I keep finding that the code listed in the tutorials does not work as it should. My last post was about one such error and now I have another big one.

On page 44 of the guide, they provide an example of using the ActionStatus component to provide a status for Ajax operations. Great! It is an awesome tool, but unfortunately, the code example they provide on that page does not work. If you copy the code from this tutorial and use it in a page and then try to see the text, you will not see it.

You can however, make two simple code changes to the code they provide and it will work as promised. But, only if you do this, will it work. So, the code that does work is seen below. What the tutorial authors missed was that an id attribute is needed for the ActionStatus component and that id value must be referenced in the status attribute of another component on the page.

ActionStatusProblemCode

Hope this helps someone else from not being confused about how ActionStatus is supposed to work. At first, I thought I was just not seeing it quickly enough (silly me…)

Setting Tab Order – Use TabOrderHint instead of TabIndex

In the last few days, I have been preparing for the Advanced Developer Certification by going page by page through the recommended Salesforce Developers Guide. I was shocked when I received an error trying to save a sample page using the code supplied in the online guide (page 39). The sample page involved setting the tab order for fields in a form and the code referenced an attribute named TabIndex. When I attempted to save the sample page, I got the following error:

Unsupported attribute tabIndex in <apex:inputField> in myPage at line 5 column 56

In my experience so far, Salesforce has been excellent about keeping their docs up to date, but I am afraid this one may have slipped through the cracks. After doing a search through some forums, I discovered that the tabIndex attribute was replaced with a new attribute named tabOrderHInt in Winter 12. So, any code created since then (which is about a year at this point), will not work using the code example supplied in their online Developers Guide.