Categories Salesforce

Salesforce Lightning Flow

What is Lightning Flow?

Lightning Flow is a new Lightning Platform service that empowers any business to create and extend the power of process automation to any customer or employee experience. With Lightning Flow, you can create guided, visual processes with Lightning components and easily add them to a record, app, portal, and console.

Wait, I think I know Visual Flows

Yes, you may also have heard the term Visual Workflow but that’s a retired product name for designing, managing, and running flows. Visual Workflow has been superseded by Lightning Flow.

Okay. Is Flow and Lightning Flow the same?

Well, here are the 3 definitions to clarify everything about Flows.

  • Lightning Flow: the product that encompasses building, managing, and running flows and processes.
  • Cloud Flow Designera point-and-click tool for building flows.
  • Flow: an application that automates a business process by collecting data and doing something in your Salesforce org or an external system.

In short, the Lightning Flow product includes a tool called the Cloud Flow Designer which helps you to create Flows.

Lovely. How is Lightning Flow different?

Using the power of low-code, drag-and-drop functionality to customer engagement, Lightning Flow delivers an innovative new way for businesses to realize the benefits of process automation: including reduced wait times for customers, digitized business workflows, and improved team productivity.

Lightning Flow brings together several innovations native to the Lightning Platform, including:

  • Lightning Flow Components: Leverage reusable Lightning components to design rich flow screens and guided, visual processes.
  • Integrated Processes: Orchestrate workflows and 3rd party services with Platform Events, External Services, and Local Actions.
  • Process-Driven Apps: Embed Lightning Flow processes into every customer and employee app experience using Lightning App Builder and Community Builder.

Got it. How to enable Lightning Flow?

Go to Setup → Process Automation Settings → Enable Lightning runtime for flows

That was simple. How does a Flow look like now?

Well, it has the new Lightning skin! Here’s a simple feedback capturing flow.

How does your Lightning Flow look?

Quick Account creation flow on your homepage. Isn’t it cool?

Salesforce Lightning Flow Sample.

It is, indeed! What’s next?

Exciting news. Lightning Flow has got some major upgrades with a brand new, faster, easier, efficient tool for building flows – Lightning Flow Builder to replace the Cloud Flow Designer. Watch out for our insights on it in our future blog posts.

We would be glad to hear feedback from you and answer any questions.

Additional Reading: Cloud Flow Designer

Categories Salesforce

How & What: Lightning Bolt Solution

In this blog post, we are going to explain how to create a Lightning Bolt Solution and distribute it. Before that let’s see what a Lightning Bolt Solution is.

Do you have at least one Lightning Community template, a custom app, or a flow category that you want to distribute? Then you’re ready to create a Lightning Bolt Solution. With Lightning Bolt Solutions, you can combine custom Lightning apps, business process flows, and Lightning Community templates and pages in easy-to-build, distributable packages.

Lightning Bolt for Salesforce: Build Once, Then Distribute and Reuse

Lightning Bolt for Salesforce lets you quickly build and distribute industry-specific Lightning Bolt Solutions to jump-start new org capabilities. Save time by building once and then reusing. Whether it’s for your own org or you’re a consulting partner or ISV, you can reduce the time required to implement solutions and cut development costs.

Bolt Solutions address the needs of specific industries and functions with tailored apps and business processes. They include:

  • Custom Apps
  • Flow Categories
  • Community Templates

USE CASE

You’re an ISV who builds a custom insurance agent app. The app includes automation to create coverage estimates and automatically notify customers of the results. Using a Lightning Bolt Solution, you can easily bundle your app and business process flows into a single package. Distribute the package to your customers to install in their Salesforce orgs, or market the solution on AppExchange.

CREATE LIGHTNING BOLT SOLUTION

From Setup, enter Lightning Bolt Solutions in the Quick Find box, and select Lightning Bolt Solutions. Click on the button “create the first one”.

On the Details and Branding page, enter information about your solution. For example, enter your company and solution names, and list the solution’s key features. Click Next.

On the Solution Highlights page, add any combination of Community templates, flow categories, and custom apps. Click Next.

Review the Summary page, and click Finish. The new Lightning Bolt Solutions is now ready for distribution.

Review Summary and Create Lightning Bolt Solution.

PUBLISH AND DISTRIBUTE THE SOLUTION

You can upload the package to AppExchange to share or sell the solution.

A package is a container for something as small as an individual component or as large as a set of related apps. Packages come in two forms—managed and unmanaged. It is recommended to use only managed packages to avoid naming conflicts with other packages in your customer’s org or your own. To create a managed package, use a Developer Edition org.

From Setup, enter Packages in the Quick Find box, and then click Packages. To package a Lightning Bolt Solution, select Lightning Bolt Solution as the component type, and select the solution that we built.

Add Lightning Bolt Solution to the package.

Upload the package. Then distribute it on AppExchange, or share the link privately with your clients, customers, or partners.

Categories Salesforce

How & What: Salesforce Platform Events (Part 1)

Platform Events

Platform Events are based on Event-Driven Architecture(EDA). EDA is a framework to define the production, detection, consumption of, and reaction to events. The two components of EDA are: event creators and event consumers. Event creators responsibility is to just create the event and Event consumers responsibility is to know when the event occurs and take an action. In EDA, no requests need to be made to a server to obtain information about a certain state. Instead, a system subscribes to an event channel and is notified whenever new states occur. Any number of consumers can receive and react to the same events in near real time.

Use Cases

Salesforce and external systems communicate through platform event messages.

  • News agency sends events to subscribed clients with the latest breaking news about traffic and road conditions in a mountain retreat destination
  • A status change in Salesforce notifies external order fulfillment apps of a product shipment order.
  • An external product app notifies Salesforce of merchandise returns

Use platform events in the following cases:

  • To send and receive custom event data with a predefined schema
  • To publish or subscribe to events in Apex
  • For the flexibility of publishing and processing events on and off the Salesforce platform

Characteristics

A platform event is a special kind of Salesforce entity, similar in many ways to an sObject. An event message is an instance of a platform event, similar to how a record is an instance of a custom object. Unlike with custom objects, you can’t update or delete event records, or view event records in the Salesforce user interface.

Create Platform Events

From Setup, enter Platform Events in the Quick Find box, then select Platform Events.
On the Platform Events page, click New Platform Event.
You define the custom data that platform events contain. Just like custom objects, you define platform events in Salesforce Development. You create a platform event definition by giving it a name and adding custom fields.
Let’s say CloudFountain wants to notify its subscribers of its product launches. We’ll create a Platform event object called CloudFountain and a text field named Description to store the message.
When you create a platform event, the system appends the __e suffix to create the API name of the event. In our example, for the CloudFountain event, the API name is Cloud_Fountain__e. The description field still is as usual Description__c

Publish Platform Events

If your app is on the Salesforce platform, you can publish events using an Apex method or with declarative tools, such as Process Builder or the Cloud Flow Designer. If your app is an external app, you can publish events using Salesforce APIs.

Publish Through Apex


To publish more than one event in the same call, add your events to a list of events, and pass the list to the EventBus.publish() method. The output of this method is an array of Database.SaveResult objects

Publish Through API

Endpoint to call
/services/data/v40.0/sobjects/Cloud_Fountain__e
JSON Request Body

Response

When you publish platform events, DML limits and other Apex governor limits apply.

Subscribe to Platform Event Notifications with Apex Triggers

With platform events, the process is similar to database triggers. You simply write an after insert Apex trigger on the event object Cloud_Fountain__e to subscribe to incoming events. Triggers provide an auto subscription mechanism in Apex. Triggers receive event notifications from various sources whether they’re published through Apex or APIs. We will see this in “How & What: Salesforce Platform Events (Part 2)”
Platform events support only after insert triggers. The after insert trigger event corresponds to the time after a platform event is published. After an event message is published, the after insert trigger is fired.
As always,  @CloudFountain, your feedback would be invaluable. Please feel free to contact us in case of any questions or concerns.

Categories Salesforce

How & What: Salesforce Platform Events (Part 2)

In our last blog post, we’ve explained what Platform Events are and how to publish them in Salesforce. In this post, we’ll be talking about Subscribing/Listening to the Platform Events to be notified of the latest news.

You can receive event notifications via Apex triggers, process builder, and visual flows.

Subscribe with Apex Triggers

Apex Triggers receive event notifications from various sources—whether they’re published through Apex or APIs. Platform events support only after insert triggers. After an event message is published, the after insert trigger is fired.

Continuing with the same event we created in our last post, Cloud_Fountain__e. Let’s create a trigger to listen to the news event and create a follow-up Case if the news event is an Urgent one.

Subscribe with Process Builder

To subscribe to event messages without code, create a process that starts when a platform event occurs.

Setup → Process Builder → New Process. From the drop-down for the process starting point, choose ‘A Platform Event Occurs’

Create Process Builder on Platform Events (for subscribing).

Then in the Add Trigger → Choose CloudFountain Platform Event. Let’s take it further and say subscribe only if the event is sent from a particular contact only, you can set the matching conditions. This can be varied per your requirements.

As we did in the trigger, we create an immediate action to create a new Case record as shown below.

Subscribe with Flows

Similarly, you can subscribe to a platform event message with a Flow by using a Wait element. Instead of starting a flow when a platform event occurs, a flow that was started previously waits for a platform event and then resumes.

Here’s an example of a Wait element that waits for a CloudFountain event message to occur. The flow resumes only if the Event’s location matches {!MailingCity_Location.MailingCity}.

{!MailingCity_Location} is just a variable in the flow.

Considerations while implementing platform events subscription:

  • There might be a delay between when an event is published and when the trigger processes the event since platform event trigger runs in its own process asynchronously.
  • A trigger processes platform event notifications sequentially in the order they’re received. An Apex trigger can receive a batch of events at once. The order of events is preserved within each batch.
  • Platform Events run under the Automated Process system user and not under the one who executed it.
  • System fields of records such as CreatedById and LastModifiedById also reference the Automated Process System user.
  • Platform Event triggers are subject to Apex governor limits and Apex Trigger Limits as usual.

Use Platform Events for any number of applications and integrations, such as processing business transactions or engaging in customer service.

Thank you for visiting the page. Please feel free to post your invaluable feedback, comments, and questions. We @CloudFountain will be glad to assist you with your Salesforce implementation.

Categories Salesforce

How & What: Salesforce Duplicate Data Management

Find Duplicates Across Your Org

Maintaining accurate, clean data is one of the most critical things you can do to get the most out of Salesforce. It builds the trust of your team and helps you work toward complying with various data security and privacy laws.

Manage Duplicates

Salesforce finds and handles duplicates using a combination of matching rules and duplicate rules. Duplicate rules and duplicate jobs specify matching rules that determine how duplicates are identified.
To manage duplicates, follow this process:

  1. Find duplicates across your org
  2. Create reports on duplicate records
  3. Manage duplicates using duplicate record sets
  4. View error logs for duplicate rules and Matching rules

1. Find Duplicates Across Your Org

Use duplicate jobs with standard or custom matching rules to scan your Salesforce business or person accounts, contacts, or leads for duplicates.
i. Go to Setup → Duplicate Jobs → Click New Job
ii. Select an object → Select an existing matching rule or create one → Click Run
iii. View summary by going to Setup → Duplicate Jobs

2. Create Reports on Duplicate Records

Use duplicate record reports to fine-tune your duplicate and matching rules and share the results of duplicate jobs.
A duplicate records report can include these records.

  • Duplicates created when a rule alerts a user to a possible duplicate, but the user creates the duplicate anyway.
  • Records manually added to a duplicate record set
  • Records in duplicate record sets generated by duplicate jobs

Go to Setup → Report Types → Create a report type → Select Duplicate Record Set as the primary object → Relate Duplicate Record Items to the primary object that you selected → Save the report type.
Save the Report Type. I named the report type as Duplicate Records.

Then create a new Report. Select the newly created Report Type, Duplicate Records, as the report type for this report. The below report shows the Duplicate Record Sets and the related Duplicate Record Items.
If you open the Duplicate Record Set, it shows the actual duplicate records too as highlighted below.

3. Manage Duplicates Using Duplicate Record Sets

A duplicate record set is a list of items identified as duplicates. It’s created when a duplicate rule or job runs. To manage duplicates that aren’t surfaced by a duplicate rule, create a duplicate record set.

  • On a duplicate record set list view, click New.
  • Specify a duplicate rule or a duplicate job.
  • In Lightning Experience, in the Related tab, click New.
  • In Lightning Experience only, merge duplicates in a set by selecting the Compare and Merge action.

4. View Error Logs for Duplicate Rules and Matching Rules
Troubleshoot system errors that prevent duplicate rules or matching rules from running. Error logs are deleted after 90 days.
Setup → Duplicate Error Logs → View the error logs