Learning to Build a Work.com Command Center Integration App

George Kenessey
Appiphony Insights
Published in
6 min readJun 3, 2020

No organization has been left untouched by the challenges COVID-19 has created. As Salesforce partners we are all asking ourselves, how can we add value to our customers as they navigate getting their communities and businesses back to work safely? As always the answers lie in the stories our customer tell us. Listening has never been more important. Once we understand the problems, we can get back to the business of solving them.

Work.com Command Center Explained

The Work.com Command Center represents a place for us to tackle these problems. It acts as a single pane of glass for organizational leaders to gain insights and take action as they face this new responsibility.

So how do you get started? Although the Work.com Command Center is new, it’s also familiar. It is based on Salesforce technologies that many of us have utilized in the past. It’s simply a matter of understand how it all works. Let’s dive in.

The Command Center is a new managed package that is installed on top of the Salesforce Customer 360 Platform. Salesforce is currently telling customers to request a new Salesforce org and install the Work.com Command Center package there. Installing it in your main Salesforce org is not recommended.

The Work.com Command Center package works with a set of Work.com objects that have been added to the Salesforce Customer 360 Platform. Users will need a minimum of a Lightning Platform Starter or CRM license to access it. They will also require a Work.com Permission Set License (PSL) to to use the Work.com Command Center managed package and objects.

The Work.com data model incorporates the existing Location and Individual objects which you may already be familiar with. It also introduces 4 new objects that are Employee Organization, Employee, Employee Crisis Assessment and Crisis (this is not all of the objects but represent the major ones relevant to this discussion, here is the link to the complete list).

The heart of the Command Center is a Salesforce Lightning App Page with 5 main components (expect more to come).

The Command Center Global Filter component allows users to select a location which then is broadcast to other components on the page using the recently introduced Lightning Messaging Service (LMS).

The Location Workplace Status, Wellness Status by Location and Employee Wellness Status components all listen for location and update their data accordingly when a specific location is broadcast. All these components provide varying metrics related to the status of workplace locations and employees.

The Global COVID-19 Tracker component uses a Tableau report to access public data to shows COVID-19 confirmed cases and deaths by location.

Below is a walkthrough video of the Work.com Command Center.

Integrating an Existing App to the Command Center

Now that we understand the core capabilities of the Work.com Command Center lets take a look at how to integrate them with an existing app. For the purposes of this exercise let’s use an example app called “Building Maintenance” which supports tracking an organization’s buildings, floors, employees and how often floors are cleaned. The app is delivered as a managed package to be installed into a Salesforce Customer 360 Platform org.

The building maintenance app has a straight forward data model that clearly represents all of its elements:

When integrating an app with Work.com you should compare its data model with that of the Work.com’s for areas of overlap. In this case both have objects representing location and employee data so the challenge is keeping these in sync. There are many methods for doing this and the right answer depends on the architectural factors at play. You will need to consider things such as:

  1. What is the frequency the objects will be updated?
  2. What is the volume of data they are likely to contain?
  3. How will the data be used for reporting?

Depending on the answers to the above questions you might consider triggers, process builder, batch apex or perhaps a third-party service like Mulesoft to coordinate the syncing of these objects with other external systems.

For this example we added lookups on the Building Maintenance app Employee, Building and Location objects and related them to their correlating objects in the Work.com data model. We then used triggers to keep them in sync. If you do this as part of a commercial app we suggest adding a custom setting to allow admins to turn triggers off when doing bulk uploads.

Next we built 3 Lighting web components that provide location specific data about which buildings and floors have been cleaned as well as which employees are at risk due to a cleaning not happening as scheduled. We then added these components to the Command Center Lighting app page.

Below is example code for creating a Lightning Web Component listening to location changes from the Command Center that should help you get started.

Finally we took the code we wrote for the integration (triggers and components) and created an extension packaged that would act as a bridge between the Building Management app and the Command Center.

If you are interested in seeing all the code for the Building Maintenance app we have made it available here: https://github.com/appiphony/building-management-app

The Building Maintenance base managed package can be installed using this link: https://login.salesforce.com/packaging/installPackage.apexp?p0=04t5w000004Lpu3

The Building Maintenance extension package can be installed using this link: https://login.salesforce.com/packaging/installPackage.apexp?p0=04t4S000000hXF3

For a great resource to quickly get started using Work.com and Command Center managed package(s) check out Jaswinder Rattanpal’s repo here: https://github.com/forcedotcom/WorkDotCom-Partners

Also, check out the Workplace Command Center for Work.com Developer Guide.

Now that you understand how the example app was built, it’s time to see it in action. Please check out the demo video below.

We hope this post has inspired you to start building your Work.com Command Center integration app to help customers get their communities and employees back to the workplace safely. Remember, start by listening to the challenges they face, then focus on the insights they’ll need and finally the actions they will have to take to be successful. Good luck!

--

--

George Kenessey
Appiphony Insights

CEO @ Appiphony, Entrepreneur, Tech Enthusiast and Father.