Category: Salesforce

noimage

Bad Data Prevention: Best Practices for Developers

Bad data quality creates trust issues. It can destroy the trust your sales team places in sales funnels, the trust your customers place in your company, and the trust executives place in data-driven decision-making. As a developer, you are in a unique position to stop bad data from entering your databases.

Sometimes good data goes bad

The first threat to your databases is natural decay, which occurs at an estimated rate of 31 percent per year. Without a proper data cleansing process in place, natural decay is going to take place due to everyday occurrences like job changes and promotions, contacts moving to different departments or regions, and companies merging or closing.

Sometimes bad data creeps in

The second threat to your databases is dirty data entering your systems due to things like human error at the input source and duplicate data that could have been prevented. This added bad data creates problems for everyone who touches that database or makes decisions based on it.

The problem of bad data is pervasive

No matter how much bad data exists in your database or enters it, it creates issues for developers. Some possible impacts:

You may be asked to customize solutions in a Salesforce instance that temporarily or partially deter bad data entry, but don’t really address the underlying problem A lack of trust in the data creates indifference among users, thwarting your attempts to establish and maintain data quality controls You create user interfaces, deploy new software applications, establish testing parameters, or generate analytics that are based on inaccurate or incomplete data A workplace culture complacent with poor data impedes your ability to help Salesforce admins improve CRM data and streamline its maintenance Recognizing the business need to address bad data

Some companies have a healthy respect for data quality, creating an internal culture that enforces data integrity and an external reputation for achieving it. For many others that don’t, the problem of bad CRM data eventually becomes impossible to ignore.

Company databases grow over time and the teams that rely on those databases to create operational efficiencies or generate important metrics often reach a tipping point concerning data quality. At this critical stage, the organization is forced to acknowledge that bad CRM data is exerting a significant and persistent drag on its operations and ability to meet strategic goals.

What can you do before bad data reaches crisis stage? Make a solid business case for good quality data. Help your organization and its key players understand that having a competitive advantage with data integrity has never been more important. Getting business executives to take notice and take action doesn’t always require a customer outcry about data breaches or a massive loss in expected revenue due to poor data quality. Move beyond the native tools of your CRM. Data-driven organizations need more than the standard toolsets. Adopt advanced solutions that integrate with your API and can identify, flag, and fix data issues ahead of time. Investigate third-party options on the

noimage

Learn Essential JavaScript Skills with Trailhead

At Dreamforce 2014, we launched the Lightning Component framework; a new way to customize the Salesforce UI. With the launch of Lightning Experience and the framework going generally available, JavaScript has become a core skill of the Salesforce developer.

The Lightning component difference

Visualforce has been hugely successful. Like many server-side UI frameworks, it lowered the bar for front-end development. There was a good amount of customization available in markup alone. Plus, extending the logic of your page allowed you to fall back on the same Apex skills you would have used for a trigger or other custom logic.

With Lightning components being a client-side language, the role of Apex has lessened. Extending the functionality of your Lightning Component beyond the markup requires developers to attain a decent command of the JavaScript language.

Transitioning to JavaScript Skills

JavaScript is the language of the web and as programming languages go, it’s easy to pick up the basics. But mastery can be tricky — its peculiarities are well-documented. If you come from a classical server-side programming language background (like Apex), it can almost be more difficult for you to break out of what you know, into the world of JavaScript.

As a developer evangelist team, we’ve spoken and written a lot about JavaScript. But as an organization, we’ve never really tackled this persona of the experienced developer transitioning from a server-side language to JavaScript. Seeing a niche, and inspired by other training material like Dan Appleman’s pluralsight course, fellow developer evangelist Josh Birk and I presented the session JavaScript for the Salesforce Platform: A Beginners Guide at TrailheaDX 2018. We had a packed room, with a lot of positive feedback.

JavaScript on Trailhead

Building on the success of this session, I’ve built the Trailhead module JavaScript Skills for Salesforce Developers. This module is targeted toward an experienced Salesforce developer who is a relative newcomer to JavaScript.

After covering some general must know things about JavaScript (both the language and the runtime), this module walks you through basics of JavaScript in the browser and the DOM, Objects, Functions, Context and Scope, and finally some core asynchronous features of JavaScript. Each unit has code samples to support the discussion and also applies these concepts to how they are implemented in Lightning components.

More general purpose developer content?

We already have some ideas for more in-depth general JavaScript learning. But is there some general-purpose developer content you would like to see our Developer Evangelist team write or speak about? Post below with your ideas. We’d love to know what skill you think will be critical to your career development as a developer and if it might be a good fit for our blog or (of course) Trailhead!

Resources

Where Are the Developer Evangelists at Dreamforce ’18?

Dreamforce is always packed to the brim with things to do and this year is no exception. Here’s where our Salesforce developer evangelists will be speaking and hanging out! They’re hoping to meet ALL of you!

What do Developer Evangelists do at Salesforce? Developer Evangelists are product experts whose mission is to help you best extend the Salesforce platform to build the best customer apps. They’re leading a bunch of fun and informative sessions, running around the Trailhead Zone in Moscone West, and all over the Developer Keynote to help you figure out how to use the latest and greatest from Salesforce!

Here’s just some of what we’ve got in store at Dreamforce for you this year. Be sure to bookmark these sessions now and add them to your schedule in Agenda Builder (Download it now in iOS or Android)!

Sessions Day 1 (Tuesday, September 25) Be An Efficient Salesforce Developer with VS Code: With VS Code becoming the new standard IDE for Salesforce developers, maybe you’ve been meaning to find time to ramp up. Well, the time is now! René Winkelmeyer and Zayne Turner will show you (read: minimal-to-no-slides!) several techniques and tips you can easily add into your day-to-day development. And the topic is so hot that we already scheduled a repeat! Advanced Lightning Components: Christophe Coenraets will show you how to get your Lightning components to the next level in this session. Learn how to reuse code between components, use popular third-party libraries, cache data efficiently, and other things you didn’t know you could do with Lightning components. MuleSoft Anypoint Platform for Salesforce Developers and Administrators: Join René Winkelmeyer where he’ll show you live how to integrate third-party systems with Salesforce (and vice versa) using the MuleSoft Anypoint Platform. Whether you identify as an admin, developer, or admineveloper, this session is for everyone who wants to skill up their integration game. Can’t make it on this day and time? No problem, he’ll give it twice. Behind the Rocks: The Making of Robotics Ridge: Heather Dykstra has been working on a super-secret project called Robotics Ridge with the amazing Reid Carlberg and Philippe Ozil. Join Heather to learn how the three of them brought five robots to life. She’ll cover everything from org administration to controlling robots. You won’t want to miss this session! Day 2 (Wednesday, September 26) Day 4 (Friday, September 28) Modern Architectures: ALM Best Practices for Citizen Development: Join Zayne Turner, along with product management director Karen Fidelak and governance experts Anna Rodriguez and Andrew Smith, to find out how to empower everyone in your business to be app builders and keep your app delivery solid. You’ll learn best practices for architecting environments, governance processes, and policies. Putting the You Into IoT: Josh Birk will be giving an introduction to IoT that anyone can follow along with. Join him to hear a story about how his nephew figured out IoT and what you can do to get started today. Keynotes Developer Keynote: One of

Implement and Use Lightning Service Components

As the Lightning ecosystem evolves, I have noticed and adopted a valuable architecture pattern: Lightning service components. In this post, I will present this concept, illustrate how it is increasingly used in base components and provide tips and best practices on how developers can create their own service components.

Understanding Lightning service components

Before diving into the specifics of Lightning service components, let’s define what a service component is: A service component is a component that provides an API for a set of functionalities. Ideally, the service should be specialized, generic and reusable.

Another important thing that differentiates a service component from other components is the fact that it does not have a graphical representation. Unlike other components, it is not visible by default. However, it can display some graphics (like a modal dialog or a toast notification) upon request if it’s a UI service.

We will use the term “caller” throughout this post to designate a component calling a service.

An overview of base service components

Since the introduction of the Lightning Data Service (the first base service component) in Winter ’17, the number of base service components has steadily increased over releases. As of Summer ’18 there are 13 base service components and this number is likely to grow in the upcoming releases.

Summer ’18 base service components

Here is an overview of the Summer ’18 base service components. Notice that the terms “library,” “API” and “service” are used interchangeably but these are all service components.

Name Component Category Description Lightning Data Service force:recordData Data Provides the ability to create, read, update, and delete Salesforce records in Lightning without the use of an Apex controller. Notification Library lightning:notificationsLibrary UI Displays messages via notices and toasts. Overlay Library lightning:overlayLibrary UI Displays messages via modals and popovers. Workspace API lightning:workspaceAPI UI API for accessing/manipulating workspaces (Tabs and Subtabs). Utility Bar API lightning:utilityBarAPI UI API for the Utility Bar. Navigation Service lightning:navigation UI Allows to navigate to a given page or to generate a page URL. Navigation Item API lightning:navigationItemAPI UI Allows to control navigation items in Lightning console apps, where navigation items display in an item menu. Quick Action API lightning:quickActionAPI UI Allows to control actions in Lightning Experience on record pages. Conversation ToolkitAPI lightning:conversationToolkitAPI Service Cloud Console integration API for Live Agent. Omni-Channel Toolkit API lightning:omniToolkitAPI Service Cloud Provides access to the API for the Omni-channel toolkit. Minimized API lightningsnapin:minimizedAPI Service Cloud Enables customization of the user interface for the minimized snap-in in Snap-ins for web. Pre-chat API lightningsnapin:prechatAPI Service Cloud Enables customization of the user interface for the pre-chat page in Snap-ins Chat. Settings API lightningsnapin:settingsAPI Service Cloud Enables to fetch certain settings from within custom components for Snap-ins for web. Using a base service component

All of the base components are documented with examples. For the sake of brevity we won’t examine all of them in detail in this post but let’s have a look at an example: displaying a notification with the notifications library.

The first

Salesforce Developer Wiki Retirement

Years ago, the Salesforce Developer Wiki was a trove of valuable technical resources but these days, there is a good part of those 1.6k pages that is now obsolete and duplicated by our documentation. We concluded that it was time to act for the sake of the quality and relevance of our technical resources.

After more than a decade of loyal services, it is now time to retire the Salesforce Developer Wiki.

Over the last few months, we’ve been scaling down the importance of the wiki by gradually unlinking it from our other sites. However, search engines keep on redirecting users to wiki content so we now need to make the final push and fully decommission it.

History

The Salesforce Developer Wiki was created more than ten years ago. It used to be the source of our developer documentation but it was also used for other purposes such as tutorials, blog posts and surveys.

What was great about it was the fact that it was written collaboratively by the community. This gave us good content with diverse point of views from a great variety of sources. Unfortunately, this collaborative nature also led to its downfall as it takes several full-time jobs, a few processes, and a robust strategy to structure and maintain such vast content. For example: each new release required a plan and resources to systematically review existing content and develop new content for newly released features.

As our company grew, we put in place strong content delivery and maintenance processes with dedicated documentation teams. We shifted our focus towards internally maintained documentation sites while reducing our efforts around the wiki. We felt that third-party sites and our blog would continue to provide diverse insights but that we needed to streamline coverage of our features.

Our plan

The Developer Wiki still holds unique and valuable content so we are taking care of preserving this precious knowledge. After carefully reviewing its content, we ended up redirecting and transferring most of it between:

We investigated and retired more than a hundred Developer Wiki links from 41 Trailhead modules and projects. This initiative guarantees the quality of your learning experience after we fully decommission the Developer Wiki (Meaning #No404Error).

Share your feedback

We would love to hear from you. Feel free to share your Developer Wiki experience and thoughts by commenting on this post.

What is Change Data Capture?

With so many different flavors of streaming events, how do you choose the right one for your use case? In this post, we’ll talk about our newest streaming event called Change Data Capture and compare it to the other events offered on the Lightning Platform.

Important: Change Data Capture is available as a developer preview in Developer Edition orgs. Change Data Capture isn’t generally available unless or until Salesforce announces its general availability in documentation or in press releases or public statements. All commands, parameters, and other features are subject to change or deprecation at any time, with or without notice. Don’t implement functionality developed with these commands or tools. In addition to the developer preview, Change Data Capture continues to be offered through a pilot program to select customers. To be nominated to participate in the pilot program, contact Salesforce. You can provide feedback and suggestions for Change Data Capture in this Trailblazer community group.

What is a Change Data Capture (CDC) event?

A CDC event, or change event, is a notification that Salesforce sends when a change to a Salesforce record occurs as part of a create, update, delete, or undelete operation. The notification includes all new and changed fields, and header fields that contain information about the change. For example, header fields indicate the type of change that triggered the event and the origin of the change. Change events support all custom objects and a subset of standard objects.

Event payload example

This change event message is sent when an account record is created with a Name and Description field.

{ “data”: { “schema”: “IeRuaY6cbI_HsV8Rv1Mc5g”, “payload”: { “ChangeEventHeader”: { “entityName”: “Account”, “recordIds”: [ “<record_ID>” ], “changeType”: “CREATE”, “changeOrigin”: “com.salesforce.core”, “transactionKey”: “001b7375-0086-250e-e6ca-b99bc3a8b69f”, “sequenceNumber”: 1, “isTransactionEnd”: true, “commitTimestamp”: 1501010206653, “commitNumber”: 92847272780, “commitUser”: “<User_ID>” }, “Name”: “Acme”, “Description”: “Worldwide leader in gadgets of the future.”, “OwnerId”: “<Owner_ID>”, “CreatedDate”: “2018-03-11T19:16:44Z”, “CreatedById”: “<User_ID>”, “LastModifiedDate”: “2018-03-11T19:16:44Z”, “LastModifiedById”: “<User_ID>” }, “event”: { “replayId”: 6 } }, “channel”: “/data/ChangeEvents” }

 

When to use Change Data Capture

Use change events to:

Receive notifications of Salesforce record changes, including create, update, delete, and undelete operations. Capture field changes for all records. Get broad access to all data regardless of sharing rules. Get information about the change in the event header, such as the origin of the change, which allows ignoring changes that your client generates. Perform data updates using transaction boundaries. Use a versioned event schema. Subscribe to mass changes in a scalable way. Get access to retained events for up to three days. Example: Data replication to an external data store

Get Cloudy Consulting has a project for a client. This client wants an integration that synchronizes Salesforce record data changes with their HR system, which is external to Salesforce. Some of the client’s HR data is created and modified in Salesforce as Employee__c custom object records. The client wants the employee data in the external HR system to be in sync with Salesforce.

The integration app has the following requirements:

Every new

The Developer’s Guide to Dreamforce 2018

We’re a bit over a month away from Dreamforce ’18 and we’ve got a lot in store! Whether you’re joining us in-person or online, this guide will help you as a developer to make the most out of your #DF18 experience.

Learn

Watch the Developer Keynote
Lead Developer Evangelist Zayne Turner, Architect Christophe Coenraets, and Principal Mobile Architect Qingqing Liu will deliver a sneak peek of the latest in Salesforce development. Don’t miss out — bookmark the keynote when the Agenda Builder goes live. (And if you’re not joining us in-person for the keynote, #NOFOMO — we’ll be livestreaming on Salesforce Live!)

Attend hundreds of Developer Sessions
We’ve got around 200 developer sessions in our theaters and breakout rooms — bookmark these sessions now (select the filter Role = Developer) and plan your session journey so you don’t miss out on great sessions for you. We’re already getting lots of buzz on sessions about Lightning Components, Salesforce DX, and Einstein!

Explore the Developer Forest
Product experts will be staffing a ton of demos in the Developer Forest. Drop by and ask questions about updates to the products you use every day, and discover new ones that will help you build better apps, faster. You can also give experts direct feedback about product roadmaps! Plus, new for 2018 you can stroll through the Tree of Integration, where we’ll demo how to connect your Salesforce apps in new ways; for example with MuleSoft.

Take a stroll through Einstein Park
Learn how to make apps smarter in Einstein Park, where product experts can walk you through everything Einstein, including Einstein Analytics. Whether you’re new to Einstein or looking for power tips, Einstein Park is where it’s at for everything AI.

Visit Robotics Ridge
Robotics Ridge was a big hit at TrailheaDX, and it’s back and better than ever for Dreamforce! This is a fun opportunity to see first-hand how different Salesforce technologies — including Lightning Platform, IoT, Platform Events, and Heroku — can work together and power a manufacturing line…of robots!

Skill up at Trailhead Bootcamps
We’ll be hosting developer-focused Bootcamps September 22-24, 2018, before the conference kicks off. Learn more and sign up in our blog post.

Connect

Meet fellow developers at the Trailblazer Community Cove
Dreamforce is all about the Salesforce Ohana, and the Trailblazer Community Cove is the perfect place to find your developer Ohana. Learn more about the online and offline Trailblazer Community, and trade stories with others.

Have fun

Win cool swag
Unlock prizes by completing special activities in different areas of the Trailhead Zone.

Take pictures
There’s photo opportunities so you can capture your #DF18 memories for years to come. Astro and friends may also be around to meet, greet, and photobomb your shots!

Rock out at Dreamfest
Dreamfest is one of the biggest, can’t-miss events within Dreamforce. Check the Dreamforce website for more details about this year’s Dreamfest (coming soon!).

Give back

Learn, earn, and give back by playing the Dreamforce Quest
Learn new developer skills, earn a limited edition community badge, and win a prize

All About Custom Lightning Page Templates

Have you ever wished for a new layout for your home page? How about more control over the columns on your record page? With the custom Lightning page template feature and a little bit of code, you can go way beyond the out of the box templates. This blog post is going to help you get started with your own templates and then we will dive into some cool things you can do!

What is a Lightning page template anyway?

Lightning page templates are components that define a page’s regions and can be used for Home, Record or App pages. Both standard and custom templates appear in the App Builder’s New Page Wizard and can be used to create new pages for an app. They are pretty easy to create, so let’s dive in!

Getting started

There are a few things you need to be aware of when building a new Lightning page template. The most important thing is to decide where you want your template to be used. You must specify if you want it available on an App, Home or Record page. You have to pick only one, since you can’t use more than one interface.

The next thing to be aware of the .svg file, which is an image type. This file works differently for Lightning page templates than Lightning components. For a component, an .svg would show up in the left-hand bar of the Lightning App Builder. For a Lightning page template, it shows up on the screen where you select which template you want to use. No matter what you do, your custom templates will appear in the new page wizard, but if you leave the .svg alone, it will be hard to distinguish your templates from each other. You can add an .svg file to provide App Builder users with an image preview of the template.

The black box here identifies where the .svg will appear.

Exactly what your users asked for: A Home Page with three regions

We’ve just received a request for an amazing custom Lightning page template in our org. Our first step is to dream about what kind of page we would like. Let’s imagine that your users have requested a Home page with three columns. It’s a pretty standard ask with a simple look and feel, but you draw it up anyway, just to be sure.

Next, we are going to create a brand new Lightning component. So we can remember, we’ve called it ThreeRegionHome (so creative, right?). We’ve got to make sure we implement the right interface for a Home page and we add a description, because we are great developers. Since we know we only need three regions and they are going to be columns, we create some attributes for those. So far our component looks like this:

ThreeRegionHome.cmp

<aura:component implements=”lightning:homeTemplate” description=”A home page you always dreamed of, 3 collumns.” > <aura:attribute name=”column1″ type=”Aura.Component[]” /> <aura:attribute name=”column2″ type=”Aura.Component[]” /> <aura:attribute name=”column3″ type=”Aura.Component[]” /> </aura:component>

It

New Density Settings for the Lightning Experience UI in Winter ‘19

We’re continuing to enhance the Lightning Experience UI in response to customer feedback. In Winter ‘19, we’ll give individual users the power to control their UI “Density Setting” in Lightning. In addition to the current view we’ve had through Summer ‘18, which we now call “Comfy”, we’re releasing a higher-density view option called “Compact.” The difference between the two views can be summarized as:

Comfy: a spacious view with labels on the top of fields and more space between page elements. Compact: a denser view with labels to the left of fields and less space between page elements.

We’ve also darkened some of our text colors to go above and beyond the color contrast requirements of the W3C’s WCAG 2.0 AA, the industry standard for web accessibility.

The above image compares the same record view across Salesforce Classic (left), Lightning Experience Comfy view (middle) and the new Lightning Experience Compact view (right) when looking at record details. As can be seen, the Compact view provides a 30% increase in information density compared to the Comfy view and reaches information density parity with Salesforce Classic.

As a developer of custom pages and components for Lightning, you may need to make some simple changes to your code to ensure the UI looks responsive to the user’s display density setting.

Below we cover the different ways you might’ve implemented your custom pages and components, plus recommendations on what steps to take.

First, and as context, we discuss the guiding principles from a User Experience perspective.

Guidelines from the User Experience team

This feature is all about giving users choices about how much information density suits their individual needs in the Lightning Experience user interface. Rather than compromising on “middle of the road” values that are not ideal for anyone, we are defining separate sets of optimized values for a “Comfy” view that has larger spacing and a “Compact” view that prioritizes the amount of information displayed on screen.

The Comfy view remains as close to previous Lightning releases as possible. The Compact view is designed to meet, or exceed, Salesforce Classic information density in key screens such as list views and record detail forms.

For the Winter ’19 release we concentrated on three main areas in the UI:

Spacing Applied to padding and margin values between elements Line height for text blocks Form element alignment on record details Top aligned in Comfy mode Left aligned in Compact mode (when the details are shown in the wide region). Note: if available form width falls below a predetermined threshold in the wide region (e.g. because of browser viewport resizing), labels will automatically shift to top alignment. Title font size Applied to higher level text elements (not body copy)

We power these changes through Salesforce Lightning Design System (SLDS) variable design tokens and classes. These give the most dramatic changes to the UI, while allowing developers to apply simple and defined CSS changes to ensure their components and features can take advantage