Categories Salesforce

Salesforce lightning – force:showToast

Toast are the message box or you can say notification box which you can use to show messages/notification on top of the view.

Toast displays a message below in the header at the top of the view.

In this blog, we are going to learn about how to show toast in salesforce Lightning record page by using “force:showToast”.

Note:-

Toast event is handled by the one.app container and it is supported in Lightning Experience, Salesforce app, and Lightning communities.

force:showToast is not available on login pages.

Now let’s learn attribute of the toast.

Toast Attributes:-

  1. title: Specifies the title of toast.
  2. message: Specifies the message to display.
  3. messageTemplate: If you want to override the ‘message’ which is specified in message attribute then you can use this attribute along with ‘messageTemplateData’.
  4. messageTemplateData: To show the overridden message you must use this attribute.
  5. key: Specifies the icon on toast when the type is not defined.Icon keys are available at the Lightning Design System Resources page.
  6. duration: Specifies the duration of toast to be shown.after specified duration toast will automatically disappear.
  7. type: the toast type which can be “error”, “warning”, “success”, “info”.The default is “other”, which is styled like an info toast and doesn’t display an icon, unless specified by the “key” attribute.
  8. mode: Controls how users can dismiss the toast. The default is “dismissible”, which displays the close button.valid mode values are:-
  • dismissible: Remains visible until you press the close button or duration has elapsed, whichever comes first.
  • pester: Remains visible until duration has elapsed. No close button is displayed.
  • sticky: Remains visible until you press the close buttons.

Now we will focus on building such interesting ‘Toast’ in our environment.

Create lightning component named “ToastComponent” and paste below code in your component.

ToastComponent.cmp

<aura:component implements=”flexipage:availableForRecordHome,force:hasRecordId,flexipage:availableForAllPageTypes” access=”global” >
<div>
<lightning:button label=”Information” variant=”brand” onclick=”{!c.showInfoToast}” />
<lightning:button label=”Error” variant=”destructive” onclick=”{!c.showErrorToast}” />
<lightning:button label=”Warning” variant=”inverse” onclick=”{!c.showWarningToast}” class = “warning_cls” />
<lightning:button label=”Success” variant=”inverse” onclick=”{!c.showSuccessToast}” class = “success_cls” />
</div>
</aura:component>

view rawToastComponent.cmp.xml hosted with ❤ by GitHub

.THIS {
}
.THIS .warning_cls {
background : #FFB75F !important;
}
.THIS .success_cls {
background : #04842D !important;
}

view rawToastComponent.css hosted with ❤ by GitHub

({
showInfoToast : function(component, event, helper) {
var toastEvent = $A.get(“e.force:showToast”);
toastEvent.setParams({
title : ‘Info Toast Message’,
message: ‘This is Info Toast…!!!’,
duration:’ 4000′,
key: ‘info_alt’,
type: ‘info’,
mode: ‘dismissible’
});
toastEvent.fire();
},
showSuccessToast : function(component, event, helper) {
var toastEvent = $A.get(“e.force:showToast”);
toastEvent.setParams({
title : ‘Success Toast Message’,
message: ‘This is Success Toast…!!!’,
duration:’ 4000′,
key: ‘info_alt’,
type: ‘success’,
mode: ‘pester’
});
toastEvent.fire();
},
showErrorToast : function(component, event, helper) {
var toastEvent = $A.get(“e.force:showToast”);
toastEvent.setParams({
title : ‘Error Toast Message’,
message:’This is Error Toast…!!!’,
messageTemplate: ‘Mode is pester ,duration is 4sec and Message is overrriden’,
duration:’ 4000′,
key: ‘info_alt’,
type: ‘error’,
mode: ‘pester’
});
toastEvent.fire();
},
showWarningToast : function(component, event, helper) {
var toastEvent = $A.get(“e.force:showToast”);
toastEvent.setParams({
title : ‘Warning Toast Message’,
message: ‘This is Warning Toast…!!!’,
messageTemplate: ‘Mode is sticky ,duration is 4sec and Message is overrriden because messageTemplateData is {1}’,
messageTemplateData: [‘Salesforce Lightning’, {
url: ‘http://thecloudfountain.com/category/blog/’,
label: ‘Click Here’,
}],
duration:’ 4000′,
key: ‘info_alt’,
type: ‘warning’,
mode: ‘sticky’
});
toastEvent.fire();
},
})

view rawToastComponentController.js hosted with ❤ by GitHub

Now our component is ready.

Next step is to show our component on home page.

Go to Home Page and click on “Edit Page” under setup menu.

Select “ToastComponent” under “Custom” tab and drag it below Assistant(right side of page).

You can see your “ToastComponent” like below –

Click on “Save” and “Activate” your component to system default (for all users) and refresh home page.

Let’s test our component.

  1. Click on “Information” button and see “Information Toast
  2. Click on “Error” button and see “Error Toast
  3. Click on “Warning” button and see “Warning Toast
  4. Click on “Success” button and see “Success Toast

Excellent Job…!!! Keep Learning…

Categories Salesforce

Brand Your Community Snap-ins Chat

Salesforce has introduced a new way of connecting and communicating with customers by using the Live Agent through a lightning component: Snap-ins.

We have already written about how to configure the live agent in communities , please find it here which is required to perform the steps mentioned in this article.

Now we are going to discuss how to display company logo, company banner, Agent avatar, waiting state image in that chat window.

Adding the logo’s and images to the documents folder:

  • Navigate to Documents Tab | Create a New Folder with Read/Write Permission and Give Access to all users by selecting “This folder is accessible by all users”
  • Once the folder is created, Click on that Folder and Click “New Document”.
  • Enter Document Name | Select “Externally available image” | Ensure the folder is the one which you have created | Choose File | Click Save

Upload document to Salesforce.

  • Open the Folder which you have created and click View for your document.

  • Copy the URL as mentioned below.
  • Go to Community Builder (Setup | Customize | Communities | All Communities | Click “Builder” next to your community).
  • Go to Page Structure, Choose “Snap-ins” component, Paste the URL in Pre-chat Background Image URL (See reference image below).
  • Similarly, upload all the documents, get their URL and paste it in Agent Avatar, Company logo page. This is how it will appear.

Note: Required Dimensions for the images:

Pre-Chat Banner: 320 * 100

Minimized Logo: 25 * 25

Waiting State: 200 * 60

Agent Avatar: 40 * 40

We would love to hear your feedback and understand how we can improve upon it.

Categories Salesforce

Implementing Sales Cloud Einstein

Sales Cloud Einstein is a complete AI solution for sales teams that increases sales productivity with machine learning and business sentiment analysis. Sales Cloud Einstein includes automation of key processes, lead scoring, and insights about relevant accounts and opportunities.

Please review the below table to understand more about Sales Cloud Einstein features.

However in this article, we are going to implement sales cloud Einstein and enable those above mentioned features.

Sales Cloud Einstein Implementation: For Admins

1. Create & Assign Sales Cloud Einstein Permission Set

a. Ensure you have enough number of Sales Cloud Einstein Permission set license, to check navigate to :

Setup | Company Profile | Company information | Under Permission Set Licenses: “Sales Cloud Einstein”.

b. Assign Sales Cloud Einstein permission set license to user :

Setup | manage users | users | select any user | under “permission set license assignment” related list | Edit Assignment | Assign “Sales Cloud Einstein” permission set license to this user.

c. Create permission set and assign it to users.

=> Navigate to : Setup | manage users | Permission set | new | Enter the Label

=> Choose License: Sales Cloud Einstein | Save.

=> Click on App permissions | Edit and enable the following features

– Use Einstein Account Insights

– Use Einstein Activity Capture

– Use Einstein Lead Scoring

– Use Einstein Automated Contacts

– Use Einstein Opportunity Insights

2. Enable Sales Cloud Einstein Features

  • Switch to Lightning : Click on Setup
  • Navigate to : Feature Settings | Sales | Einstein Activity Capture | Einstein Setup Assistant

3. Wait 24 hours and Modify Page Layouts and List views

  • Include Einstein lightning Component to Account Page, Open any Account record.
  • Click on the setup icon and click Edit Page
  • From App Builder, include the Einstein Component to the page layout

Sales Cloud Einstein Implementation : For Users.

Once salesforce admin enabled Sales Cloud Einstein and setup the permissions , once users logged in they would see a prompt to start using Einstein.

Clicking the link will redirect them to associate email and calendar either Office 365 or Gmail to salesforce in order to start using Einstein Activity Capture.

After this is one-time setup process, users will be provided an option to control their activity visibility within salesforce, either they can share with everyone or any specific group or only within themselves.

Important Aspects of Sales Cloud Einstein

a. Einstein Lead Scoring : Focus on highest value leads first

    • From Setup | Einstein Sales | Assisted Setup
    • If it’s your first time visiting the setup page, click Get Started.

Note : The Sales Cloud Einstein setup page shows all the steps you need for Sales Cloud Einstein deployment, including how to assign Einstein to users.

    • Click Set Up next to Einstein Leading Scoring.
    • On the Settings page, click Set Up Now.
    • Choose the lead conversion milestone that matches your business practices. Does your sales team create opportunities when they convert leads, or do they simply convert leads to accounts and contacts?
    • Click Enable.
    • Using the Lightning App Builder, make sure that the Einstein Lead Score component was added to Lightning pages for leads. In Salesforce Classic, add the Einstein Score field to lead page layouts. The Einstein Score field can’t be used on the same page layout as the Lead Score Distribution or Conversion Rate by Lead Score report components.
    • After insights are available, add the Einstein Score field to public lead list views. Salesforce automatically adds this field to default list views.

b. Einstein Opportunity Insights : Secures opportunities and reduced forecast risk

Note : Follow same steps as Einstein Lead Scoring to enable Opportunity Insight and other following features

c. Einstein Account Insights : Discovers key business developments impacting your customers

d. Einstein Activity Capture : Logs data automatically so you can spend more time selling

e. Einstein Automated Contacts : Detects & recommends new contacts that can be added in few clicks

Note :

1. Opportunity Insights requires Activity Capture

2. Einstein Requires Standard Lead Conversion to Opportunity

3. Einstein Activity Capture requires Gmail / Office 365

4. Need to check your Sales Cloud Einstein Readiness?

http://einsteinreadiness.salesforce.com

Important FAQ’s:

1. Do I need to deploy to all users?

No, Once the permission set license is available, you can decide on how many users should have access to sales cloud Einstein

2. Is Lightning Required?

Yes, To benefit from the rich UX visualizations of Sales Cloud Einstein (e.g., Einstein Lead Scoring and Einstein Opportunity Insights in Assistant), you need to be on Salesforce Lightning.

If you are still on salesforce classic, you can still use the lead score from Einstein Lead Scoring as a field. However , you will not get the visibility into why the lead was scored as such.

  • Image and Features table source: Salesforce

Your feedback is extremely invaluable to us and helps us improve our content.

CloudFountain Inc. provides Salesforce Implementation services including custom development, Salesforce integration, Salesforce Lightning development, Salesforce communities, technical debt reduction, etc.

Categories Salesforce

Configure Omni Channel in Salesforce

#Omni-Channel can be effectively used to prioritize the work items, we can route the important work items to agents quickly. It is also used to manage the agents’ capacity so that they can be provided with the number of assignments they can handle. Omni-Channel is flexible, customizable feature, most importantly it can be configured declaratively without writing a single line of code.
You can also define which agents can work on different types of assignments. For example, you can create one group of agents to respond to leads and sales inquiries and another group that helps customers with support questions.
Most importantly, Omni-Channel take care of these assignments automatically, so that agents no longer have to pick and choose work assignments manually from the queue which definitely saves time, effort and brainpower especially for call centers.
Let’s take a look on how to configure Omni-Channel, Follow the below-mentioned steps.

1. Enable Omni-Channel

   a. From Setup, enter Omni-Channel Settings in the Quick Find box, then select Omni-Channel Settings.
   b. Select Enable Omni-Channel.
   c. Click Save.

Omni-channel settings

2. Create a service channel and routing configuration.

We work with cases for this module. So the first step is to make cases available for routing with a service channel.
   a. From Setup, enter Omni-Channel in the Quick Find box, then select Service Channels.
  b. Click New.
  c. Enter the name Cases (the API Name will auto-fill to Cases).
  d. Select Cases as the Salesforce object.
  e. Click Save.
  f. Now, Omni-Channel can route cases. The next step is to make a basic routing configuration so Omni-Channel knows how to get these cases to agents.

3. Create a Routing Configuration

  a. From Setup, enter Omni-Channel in the Quick Find box, then select Routing Configurations.
  b. Click New.
  c. Enter the name High-Priority Cases (the Developer Name auto-fills to High_Priority_Cases).
  d. Set the Routing Priority: 1.
  e. Select the Routing Model: Most Available.
  f. Set the Units of Capacity: 4.
  g. Click Save.

4. Link Your Routing Configuration to a Queue

With your routing configuration set, we need a queue to link to it. Let’s create a queue!
  a. From Setup, enter Manage Users in the Quick Find box, then select Queues.
  b. Click New.
  c. Enter the label High-Priority Cases (the queue name auto-fills to High_Priority_Cases).
  d. In the Routing Configuration field, click the Lookup icon, and select the routing configuration you just created (High-Priority Cases).
  e. Under Supported Objects, select Case in the Available Objects, and click Add to move it to the Selected Objects.
  f. Under Queue Members, in Search, select Public Groups and select All Internal Users in the Available Members list, then click Add to move it to Selected Users. Add yourself to Selected Users too.
  g. Click Save.

5. Set Presence Status for Agents

Agents need statuses so they can control when work comes in for them. Now, we create a presence status for agents to use when they want to be assigned high-priority cases.
  a. From Setup, enter Omni-Channel in the Quick Find box, then select Presence Statuses.
  b. Click New.
  c. Enter the Status Name Available – Cases (the API name auto-fills to Available_Cases).
  d. Under Status Options, select Online.
  e. Under Service Channels, Select Cases in the Available Channels, and click Add to move it to the Selected Channels.
  f. Click Save.
Now that you have a presence status, make it available to users (including yourself!).
  a. From Setup, enter Manage Users in the Quick Find box, then select Profiles.
  b. Click the name of the profile you want to enable Omni-Channel for. Let’s start with System Administrator.
  c. Hover over Enabled Service Presence Status Access and click Edit.
  d. Select Available – Cases in the Available Service Presence Status, and click Add to move it to the Selected Service Presence Status.
  e. Click Save.
  f. Repeat for any other profiles you want to use with Omni-Channel. If you plan to make new users in your hands-on org to use with Omni-Channel, repeat these steps for the Custom: Support Profile or the Standard User profile.

6. Add Omni-Channel to a Console

  a. Go to Setup | Build | Create | Apps.
  b. Under Apps, Click New.
  c. Select the Console type and click Next.
  d. Enter the App Label Omni-Channel Console (the API name auto-fills to Omni_Channel_Console).
  e. Click Next.
  f. Click Next to skip the image selection.
For Navigation Tab Items, in the Available Items, select Cases, Home, Accounts, and Contacts, and click Add to move it to the Selected Items.
  g. Click Next.
Make Cases and Contacts open as subtabs of Account Name (Account).
  a. Click Next.
  b. Make this console visible to all profiles, and make it the default for Custom: Support Profile, Standard User, and System Administrator.
  c. Click Save.
  d. Now, we’ll add Omni-Channel as a console component. From Apps page, click Edit next to Omni-Channel Console.
  e. Under Choose Console Components, in the Available Items, choose Omni-Channel, and click Add to move it to the Selected Items.
  f. Click Save.
Time to Test our Omni- Channel:
  a. Go to Cases Tab
  b. Click New.
  c. Select the Priority High.
  d. Select the Case Origin Web.
  e. Enter the Subject: Website is down
  f. Enter any description you want.
  g. Click Save.
Because you created the case, you’re already the case owner. Let’s go to the console to route it.
  a. Use the app launcher to select Omni-Channel Console.
  b. From the console, click Omni-Channel in the console footer to open up the Omni-Channel widget. Set your status to Available – Cases.
  c. Go to the Cases console tab and select All Open Cases from the dropdown.
  d. Select the checkbox next to case you created and click Change Owner.
  e. Select Queue, and use the lookup to select High-Priority Cases.
  f. Click Save.
You get a notification in the Omni-Channel widget. Go ahead and accept it; the case opens in a tab in your console.

Decline a Work Request in Omni-Channel:

If we are assigning the task to agents, there has to be little more freedom to let them choose what they work on. It also means that if they’re assigned something that isn’t right for them, they can quickly decline it and move on. The work has a better chance of finding the right agent, and the agent who declined it can get back to the work that’s right for them.
Let’s pretend that in addition to your High Priority Cases queue, you have another queue called Cases. So, work that comes through the Cases queue is less urgent than the High-Priority Cases queue. What happens when you’re an agent assigned to the High-Priority Cases queue, and you receive a work request for something like “A customer can’t find our FAQ page”?
That isn’t exactly work-stopping, is it? To make sure high-priority work gets the attention it deserves, let’s turn on work declining, and create a reason “Incorrect queue.” This way, the supervisor will know when there’s low-priority work sludging up the high-priority queue.

1. Create the Decline Reason

  a. From Setup, enter Omni-Channel in the Quick Find box, then select Presence Decline Reasons.
  b. Click New.
  c. Enter the name: Incorrect queue (the Developer Name auto-fills to Incorrect_queue).
  d. Click Save.

2. Add Decline and Decline Reasons to Your Presence Configuration

  a. From Setup, enter Omni-Channel in the Quick Find box, then select Presence Configurations.
  b. Click Edit next to Default Presence Configuration.
  c. Select Allow Agents to Decline Requests.
  d. Select Allow Agents to Choose a Decline Reason.
  e. Under Assign Decline Reasons, in the Available Decline Reasons, choose Incorrect queue, and click Add to move it to the Selected Decline Reasons.
  f. Click Save.
Perfect! Now you’re able to decline a work request in the console, and you can indicate that the work is in the wrong queue.
Let’s try it out. We need to create a case and then route it with Omni-Channel, just like we did last time.

3. Create a New Case

  a. Go to the Cases tab.
  b. Click New.
  c. Select the Priority Low.
  d. Select the Case Origin Web.
  e. Enter the Subject: A customer can’t find our FAQ page
  f. Enter any description you want.
  g. Click Save.

4. Route the New Case and Decline It from the Omni-Channel Widget

  a. Use the app launcher to select Omni-Channel Console. If the first case is still open in your console, you can ignore it.
  b. From the console, click Omni-Channel in the console footer to open up the Omni-Channel widget. Set your status to Available – Cases.
  c. Go to the Cases console tab and select All Open Cases from the dropdown.
  d. Select the checkbox next your new case and click Change Owner.
  e. Select Queue, and use the lookup to select High-Priority Cases.
  f. Click Save.
  g. You get a notification in the Omni-Channel widget. Click Decline.
  h. Click Select a Decline Reason and Incorrect queue.
  i. Click Confirm. The request disappears from your Omni-Channel widget.

We request our readers to try it and let us know the feedback on the same.

Categories Salesforce

How & What: Salesforce Path

One of the main concerns of Salespersons or anyone using Salesforce is not having a complete picture of what stage a lead/opportunity/order/case is in the business process and what needs to be done at different stages to progress it further. A standard page layout doesn’t have the provision to be able to highlight this information in a cleaner way. This is where Salesforce Path (or simply called Path) comes in and addresses the issue beautifully.

Some of the features of Salesforce Path are:

  • Visual Representation of Business Process e.g. Sales process, service ticket process, lead lifecycle.
  • Path helps in progressing through the stages in an easier, efficient and faster way.
  • Available for Lightning Components, Lightning Communities.
  • Can be setup based on picklist values and available for record types.
  • Can be used on Standard object like Opporutinities, Leads, Accounts, Contacts, Campaigns, Contracts, Orders and all custom objects.

Path View

Path showcases all the stages the lead/opportunity/order has to progress through and also at which stage currently they are at.

For every stage, Path showcases the key fields that are required to be filled in and also displays the important guidance required to successfully pass that particular stage. All this can be configured by a Salesforce administrator in the setup. In the Guidance for success section, you can include images, links as well.

Enable Path

Go to Setup → Path Settings → Enable.

If “Remember User’s Path Preferences” is selected, the path remembers its previous state.

Configure Path

To Create a New Path.

Go to Setup → Path Settings → Click New Path

Just choose the object, record type and the picklist field that you want the Path to be configured on.

In step 2, drag and drop the key fields and also the guidance for success for each of the picklist stage values. Save.

And finally, drag and drop the new Path that you created onto the page layout. That’s all.

Considerations

When you create paths, you decide:

  • Which fields and content appear for your users at each step in the process?
  • What good advice, helpful reminders, useful links, and best practices to include at each step.
  • How many different paths to provide to your users. For example, you might provide different paths for inside sales and outside sales, or different paths for delivery status of different products or services.
  • When paths to be made available to users.

Please feel free to contact us in case of any questions or concerns. Your feedback is invaluable to us.