15 June 2016

Auto Assign Team Members

** this blog has been moved to Sites

This Process and Flow combination automatically assigns team members based on the region of the account.  See my previous post regarding the region field population.  Formula for Regions

First, thank you to Derek Davis providing the structure of this flow.  I basically filled in the blanks.  The Flow...



We have mixed team members.  A RAM and an AE are assigned to each region regardless of the type of account it is. (ex. bank, accounting firm, law firm, ect...)
And a responder rep is assigned to the team IF the account is a Bank record type.  Responders are based on region as well.

So we lookup the account info...


And get the RecordType and Region from the lookup. 

Next we Fast Lookup the Account and identify the current team members. 



We want to different paths.   One path if there are team members on the account currently.  And another path if there are none.  So, Decision...


If the team member does exist we're going to delete them...


If they don't exist we're going to assign them based on the region.   So another decision to find the region.   This is the path after the team members are deleted too. 



Create the RAM member and AE member...







Then, if it's a bank, check the region and assign the responder reps.








If the team exists it's deleted and the team is re-added to the account.   This 'check' by Salesforce is ONLY done if the Region field IS CHANGED.   As shown in the process builder screen shots below. 





That's it.  No more having to run reports, check the team members are correct, export and correct a csv file and then upsert the correct teams.,





Process Builder and Visual Workflow data from the Salesforce help site.

Lightning Process Builder

Many of the tasks you normally assign, the emails you regularly send, and other record updates are vital parts of your organization's standard processes. Instead of doing this repetitive work manually, you can configure processes to do it automatically.
Available in: both Salesforce Classic and Lightning Experience
Available in: Professional, Enterprise, Performance, Unlimited, and Developer Editions
The Process Builder is a workflow tool that helps you easily automate your business processes by providing a powerful and user-friendly graphical representation of your process as you build it. The Process Builder’s simple and powerful design allows you to:
  • Create your processes using a convenient layout with point-and-click efficiency.
  • Create your whole process in one place rather than using multiple workflow rules.
  • Create processes by collaborating with different teams in your business.
  • Stop using Apex code to automate simple tasks.
Automated processes in the Process Builder are based on records and consist of:
  • Criteria that determine when to execute action groups.
  • Immediate and scheduled actions to execute when those criteria are met.
Any change that causes a record to match the criteria can automatically trigger the action group. A single process can also execute multiple action groups—so it’s easy to automate all of your business records, like accounts, in one place.
You can use the more powerful and flexible Process Builder to perform the same actions as workflow. With the Process Builder, you can:
  • Create a record
  • Update any related record—not just the record or its parent
  • Use a quick action to create a record, update a record, or log a call
  • Launch a flow—you can’t schedule this action with workflow
  • Send an email
  • Post to Chatter
  • Submit for approval
If you need your process to do more than what those actions allow, don’t worry. You can also call Apex or a flow from a process.




Visual Workflow

Visual Workflow lets you automate business processes by building flows and distributing them to the right users or systems. A flow is an application that can execute logic, interact with the Salesforce database, call Apex classes, and collect data from users. You can build flows by using the Cloud Flow Designer.
Available in: both Salesforce Classic and Lightning Experience
Available in: Enterprise, Performance, Unlimited, and Developer Editions
Flows can either require user interaction—perhaps a wizard or guided UI for data entry—or run in the background on their own—perhaps something that automatically transfers records when a user’s role changes.







Support team - Auto Case Closed

The Customer Support team is tired of hitting Save on a Case and then Closing it on the Case Closed page.
Creating a process to automatically mark a case closed when it's saved.

Overview of the Process:



Only when the Case is created



Just do it. 



Update the Status field to Closed



Now when a Case is Saved...


It's updated to Closed Status...





Auto Account Ownership based on geography

I've created rules to assign the account owner based on states and countries for our company.
In the back of my mind I've always thought maybe one of the Territory Management features out of the box would be sufficient.  But I could see the whole process in my head before any work was done so I just built it.

Step one.  Custom Fields to assign a Region and Region - Global to each account.  The rules are based on the existing definitions of each region our company already had in place.  Six Regions in the US.  Multiple Regions in Europe.  And a half dozen or so Global Regions that the sub Regions fit into.

region sub  region global
AsiaPac (CAP) Asia Pacific
Rest of Asia Asia Pacific
Antartica International
Latin America Latin America
North America North America
Rest of North America North America
Africa South Africa & Africa
CQS South Africa & Africa
Europe UK & Europe
UK & Nordic UK & Europe

AND

region segment
Canada North America
Central North America
Mid-Atlantic North America
Northeast North America
South Central North America
Southeast North America
West North America

To assign the region and region - global fields based on the state/country I created formulas on the fields themselves.  They actually fit just under the character limits for formula fields. 

Region: 

IF(
    OR(
        AND(
            ISBLANK(BillingState),
            BillingCountry = "United States"
        ),
        AND(
            ISBLANK(BillingState),
            ISBLANK(BillingCountry)
        )
    ),
    "None",


IF( 
BillingCountry = "Canada", 
"Canada", 

if( 
    contains("Algeria:Angola:Benin:Burundi:Cape Verde:Central African Republic:Chad:Comoros:Congo:Congo, the Democratic Republic of the:Cote d'Ivoire:Djibouti:Egypt:Equatorial Guinea:Gabon:Guinea:Madagascar:Mali:Mauritania:Mayotte:Morocco:Mozambique:Niger:Reunion:Sao Tome and Principe:Senegal:Sierra Leone:Somalia:Sudan:Tanzania, United Republic of:Togo:Tunisia:Libya:South Sudan", BillingCountry), 
    "Africa", 

IF( 
    CONTAINS("China:Australia:Malaysia:New Zealand:Singapore", BillingCountry), 
    "AsiaPac (CAP)", 

IF( 
    CONTAINS("Belgium:France:Germany:Italy:Luxembourg:Netherlands:Portugal:Spain:Switzerland:Aland Islands:Albania:Andorra:Austria:Belarus:Bosnia and Herzegovina:Bulgaria:Croatia:Czech Republic:Faroe Islands:Gibraltar:Greece:Guernsey:Holy See (Vatican City State):Hungary:Iceland:Liechtenstein:Malta:Moldova, Republic of:Monaco:Montenegro:Poland:Romania:Russian Federation:San Marino:Serbia:Slovakia:Slovenia:Turkey:Ukraine:Macedonia, the former Yugoslav Republic of:Saint Helena, Ascension and Tristan da Cunha:Cyprus", BillingCountry), 
"Europe", 

IF( 
contains("Falkland Islands (Malvinas):Argentina:Brazil:Chile:Colombia:Ecuador:French Guiana:Guyana:Paraguay:Peru:Suriname:Uruguay:Bolivia, Plurinational State of:Venezuela, Bolivarian Republic of", BillingCountry), 
"Latin America", 

IF( 
contains("Virgin Islands, British:Anguilla:Antigua and Barbuda:Aruba:Bahamas:Barbados:Belize:Bermuda:Cayman Islands:Costa Rica:Cuba:Dominica:Dominican Republic:El Salvador:Greenland:Grenada:Guadeloupe:Guatemala:Haiti:Honduras:Guam:Jamaica:Martinique:Mexico:Montserrat:Nicaragua:Panama:Puerto Rico:Saint Kitts and Nevis:Saint Lucia:Saint Pierre and Miquelon:Saint Vincent and the Grenadines:Trinidad and Tobago:Turks and Caicos Islands:Bonaire, Sint Eustatius and Saba:Curaçao:Saint Martin (French part):Sint Maarten (Dutch part)", BillingCountry), 
"Rest of North America", 

IF( 
contains("Afghanistan:Armenia:Azerbaijan:Bahrain:Bangladesh:Bhutan:British Indian Ocean Territory:Brunei Darussalam:Cambodia:Christmas Island:Cocos (Keeling) Islands:Cook Islands:Fiji:French Polynesia:Georgia:India:Indonesia:Iran, Islamic Republic of:Iraq:Israel:Japan:Jordan:Kazakhstan:Kiribati:Korea, Democratic People's Republic of:Korea, Republic of:Kuwait:Kyrgyzstan:Lao People's Democratic Republic:Lebanon:Macao:Maldives:Mongolia:Myanmar:Nauru:Nepal:New Caledonia:Niue:Norfolk Island:Oman:Pakistan:Papua New Guinea:Philippines:Pitcairn:Qatar:Samoa:Saudi Arabia:Solomon Islands:Sri Lanka:Syrian Arab Republic:Taiwan:Tajikistan:Thailand:Timor-Leste:Tokelau:Micronesia:Tonga:Turkmenistan:Tuvalu:United Arab Emirates:Uzbekistan:Vanuatu:Yemen:Palestine:Viet Nam", BillingCountry), 
"Rest of Asia", 

IF( 
contains("Botswana:Cameroon:Eritrea:Ethiopia:Gambia:Ghana:Kenya:Lesotho:Liberia:Malawi:Mauritius:Namibia:Nigeria:Rwanda:Seychelles:South Africa:Swaziland:Uganda:Zambia:Zimbabwe", BillingCountry), 
"CQS", 

IF( 
contains("Estonia:Latvia:Lithuania:Jersey:Denmark:Finland:Norway:Sweden:Ireland:Isle of Man:United Kingdom", BillingCountry), 
"UK & Nordic", 

IF(
contains("DE:KY:MD:NC:OH:SC:VA:WV:DC",BillingState),
"Mid-Atlantic",

IF(
contains("AK:AZ:CA:CO:HI:ID:MT:NV:OR:UT:WA:WY",BillingState),
"West",

IF(
contains("CT:ME:MA:NH:NJ:NY:PA:RI:VT",BillingState),
"Northeast",

IF(
contains("AL:AR:FL:GA:LA:MS:TN:VI",BillingState),
"Southeast",

IF(
contains("IL:IN:IA:MI:MN:MO:NE:ND:SD:WI",BillingState),
"Central",

IF(
contains("KS:NM:OK:TX",BillingState),
"South Central",


"NONE"))))))))))))))))

AND   Region - Global

IF(
   ISBLANK(BillingCountry),
    "None",

IF(
contains("United States:Canada",BillingCountry),
"North America", 

if(
contains("Algeria:Angola:Benin:Burkina Faso:Burundi:Cape Verde:Central African Republic:Chad:Comoros:Congo:Congo, the Democratic Republic of the:Cote d'Ivoire:Djibouti:Egypt:Equatorial Guinea:Gabon:Guinea:Guinea-Bissau:Madagascar:Mali:Mauritania:Mayotte:Morocco:Mozambique:Niger:Reunion:Sao Tome and Principe:Senegal:Sierra Leone:Somalia:Sudan:Tanzania, United Republic of:Togo:Tunisia:Western Sahara:Libya:South Sudan", BillingCountry),
"South Africa & Africa",

IF(
CONTAINS("China:Australia:Malaysia:New Zealand:Singapore", BillingCountry),
"Asia Pacific",

IF(
CONTAINS("Belgium:France:Germany:Italy:Luxembourg:Netherlands:Portugal:Spain:Switzerland:Aland Islands:Albania:Andorra:Austria:Belarus:Bosnia and Herzegovina:Bulgaria:Croatia:Czech Republic:Faroe Islands:Gibraltar:Greece:Guernsey:Holy See (Vatican City State):Hungary:Iceland:Liechtenstein:Malta:Moldova, Republic of:Monaco:Montenegro:Poland:Romania:Russian Federation:San Marino:Serbia:Slovakia:Slovenia:Svalbard and Jan Mayen:Turkey:Ukraine:Macedonia, the former Yugoslav Republic of:Saint Helena, Ascension and Tristan da Cunha:Cyprus", BillingCountry),
"UK & Europe",

IF(
CONTAINS("Falkland Islands (Malvinas):Argentina:Brazil:Chile:Colombia:Ecuador:French Guiana:Guyana:Paraguay:Peru:Suriname:Uruguay:Bolivia, Plurinational State of:Venezuela, Bolivarian Republic of", BillingCountry),
"Latin America",

IF(
CONTAINS("Virgin Islands, British:Anguilla:Antigua and Barbuda:Aruba:Bahamas:Barbados:Belize:Bermuda:Cayman Islands:Costa Rica:Cuba:Dominica:Dominican Republic:El Salvador:Greenland:Grenada:Guadeloupe:Guatemala:Haiti:Honduras:Jamaica:Martinique:Mexico:Montserrat:Nicaragua:Panama:Puerto Rico:Saint Kitts and Nevis:Saint Lucia:Saint Pierre and Miquelon:Saint Vincent and the Grenadines:Trinidad and Tobago:Turks and Caicos Islands:Bonaire, Sint Eustatius and Saba:Curaçao:Saint Barthélemy:Saint Martin (French part):Sint Maarten (Dutch part)", BillingCountry),
"North America",

IF(
CONTAINS("Afghanistan:Armenia:Micronesia:Azerbaijan:Bahrain:Bangladesh:Bhutan:British Indian Ocean Territory:Brunei Darussalam:Cambodia:Christmas Island:Cocos (Keeling) Islands:Cook Islands:Fiji:French Polynesia:Georgia:Guam:India:Indonesia:Iran, Islamic Republic of:Iraq:Israel:Japan:Jordan:Kazakhstan:Kiribati:Korea, Democratic People's Republic of:Korea, Republic of:Kuwait:Kyrgyzstan:Lao People's Democratic Republic:Lebanon:Macao:Maldives:Mongolia:Myanmar:Nauru:Nepal:New Caledonia:Niue:Norfolk Island:Oman:Pakistan:Papua New Guinea:Philippines:Pitcairn:Qatar:Samoa:Saudi Arabia:Solomon Islands:Sri Lanka:Syrian Arab Republic:Taiwan:Tajikistan:Thailand:Timor-Leste:Tokelau:Tonga:Turkmenistan:Tuvalu:United Arab Emirates:Uzbekistan:Vanuatu:Wallis and Futuna:Yemen:Palestine:Viet Nam", BillingCountry),
"Asia Pacific",

IF(
CONTAINS("Botswana:Cameroon:Eritrea:Ethiopia:Gambia:Ghana:Kenya:Lesotho:Liberia:Malawi:Mauritius:Namibia:Nigeria:Rwanda:Seychelles:South Africa:Swaziland:Uganda:Zambia:Zimbabwe", BillingCountry), 
"South Africa & Africa",

IF(
Contains("Estonia:Latvia:Lithuania:Jersey:Denmark:Finland:Norway:Sweden:Ireland:Isle of Man:United Kingdom", BillingCountry),
"UK & Europe",

"NONE"))))))))))

DONE

Once these fields are set I can base ownership on the population of these fields. 

here's an example of some of the filters. 



At the top of the flow I have some exceptions to the rules which is nice because I can be in complete control of what accounts go to who. 

If anyone thinks I should be doing this a different way I'm open to suggestions.  I was just thinking I need to explore Territory Management again in the sandbox and see if it's easier. 

This works for now though. 






Setting up Service Console on Salesforce from scratch


This web log picks up roughly two weeks into this project.   I'm about to set up the pilot users for Service Cloud in our production environment.

I'll post as items come up or as I remember them.

I recently set up a permission set for the 2 users in the sandbox.  Originally I just gave the service console access to the entire profile these 2 users were a part of but now that I'm about to roll this out to production and only want 2 users to pilot I need to create a permission set.

Jen and Teri have permission to access the console.

I'll be exporting the audit trail from the sandbox and going step by step back through the process in production.  I'll note each step here.

Turn on Knowledge and Service Cloud user access on my profile.
Pretty much following the guide for setting this up. Salesforce Console Guide
Created custom app Customer Support Console  - pg. 13 of the guide
Added our Image.  Received it from MarketingChoose Navigation Tab Items













Pinned to left.  300 pixels

Added History and Macro Browser as Console Components














I've made Cases a subtab of Contact because the process of creating a case should be as such; 
Find the Contact and Account, then create the Case from the Contact record.  

Now rethinking this because Cases will be the primary object especially when email and web to case are implemented. 


I've whitelisted our website but not really sure we'll need that. 




The only Profile that this app is assigned to is the System Admin.  Jen and Teri will have access for now via the permission set
From Audit Trail in Sandbox...   
Live Agent enabled.
Went to production to enable this.  Setup. Live Agent Setttings. Enable Live Agent.     per #7. on pg 13 of the guide.

I see there's an option to have customized keyboard shortcuts.  Not sure we'll need them.   I'll review and let the team know about the option.  See if they like it.

Changed profile Customer Service: Opportunity object permissions were changed from No Access to Read
Changed profile Customer Service: Push Topic object permissions were changed from No Access to Read
This is so the customer service reps can use the Live Agent feature when it's rolled out. 

Turned on Interaction Logs.  pg 20 of the guide.   Did not set it up beyond turning it on.

Created permission set for 'service console user'.  Added Jen and Teri.  6/10/2016 LH Added all of the support reps to this profile except Nikita in Inida.
Gave 'Service Cloud User' access to Jen and Teri via their individual user pages   6/10/2016  LH  Added all support reps minus one

Creating a new Contact Page for customer support.  One that has a Case creation option with field in the Feed section.  For fast creating cases.
     deleted my 'act-on' contact page layout

Turned on 'enable Case feed action and Feed Items' from the Support Settings on the CAse object in sandbox.

Limited the number of tabs that can be open at a time to 5.   then removed this because of feedback

Built training material for the support team to know how to create cases now.

Provided training and console walk-though to the reps.  Sent the deck.

Made first name required field.

Created Validation Account workflow to create an account and then a contact.  Email is required here.

6/10/2016  Turned on the console for the support reps.  removed old customer support app from view.  gave access to the console app and added Chatter tab




More info from the Salesforce help site. 



Set Up a Salesforce Console for Service


Create and customize a console app, then assign the Service Cloud User feature license to users.
Salesforce console available in Salesforce Classic and App Launcher in Lightning Experience. Setup for Salesforce console available in Salesforce Classic.
Available in: Professional, Enterprise, Performance, Unlimited, and Developer Editions

User Permissions Needed
To set up a Salesforce console for Service:“Customize Application”
AND
“Service Cloud User”
Important
If you plan to add Live Agent to a console, set it up completely before you set up your console.
  1. Customize highlight panels for all objects and turn them on.
  2. Create a console app and assign it to user profiles.
  3. Optionally, for support agents:
  4. Assign users the Service Cloud User feature license.
Tip
To add third-party integrations, or expand console customizations to new levels, advanced Salesforce admins and developers can create console components, or use code with an API named the Salesforce Console Integration Toolkit.





Create Queues


Create queues to prioritize, distribute, and assign records to teams who share workloads. There’s no limit to the number of queues you can create, and you can choose when queue members receive email notifications.
Available in: both Salesforce Classic and Lightning Experience
Available in: Contact Manager, Group, Professional, Enterprise, Performance, Unlimited, Developer, and Database.com Editions
Service contract queues available in: Professional, Enterprise, Performance, Unlimited, and Developer Editions with the Service Cloud
Lead queues and case queues are not available in Database.com
User Permissions Needed
To create or change queues:“Customize Application”
AND
“Manage Public List Views”
To change queues created by other users:“Customize Application”
AND
“Manage Public List Views” and “Manage Users”
  1. From Setup, enter Queues in the Quick Find box, then select Queues.
  2. Click New.
  3. Type a label and name. The label appears in the user interface as a list view, and the name is used by the API and managed packages.
  4. Choose email notification settings for the queue.
    To notifyYou must
    One email address when new records are added to the queue.Add an email address to Queue Email. You can add an email address for an individual or an email distribution list.
    All queue members individually when new records are added to the queue.Leave Queue Email blank.
    All queue members and the Queue Email individually when new records are added to the queue.Add an email address to Queue Email and select Send Email to Members.
  5. If your org uses divisions, select the queue’s default division. Cases inherit the division of the contact they’re related to, but when a case doesn’t have a contact, it’s assigned to the default global division.
  6. Add the objects available to the queue. You can add cases, leads, orders, custom objects, service contracts, or knowledge article versions.
  7. Add queue members. You can add individuals, roles, public groups, territories, connections, or partner users.
    . Depending on your org’s sharing settings, only queue members and users above them in the role hierarchy can take ownership of records in the queue.
  8. Click Save.
Tip
After you create a queue for cases or leads, you can set up assignment rules to route cases or leads to it.
Note
Before you can delete a queue, reassign its records to another owner and remove it from any assignment rules.



Created a Validation Account Flow

Created a Flow that provides a couple of screens to the support reps.  Screens provide the necessary fields, and only the necessary fields to create an account, contact and case, all associated with each other.

Overview of the Flow Design



First the support rep must enter the account info.

Screen for the rep to fill out.  Only required fields available. 



Once the rep hits 'next' the account is created immediately.


Screen asking rep for contact and case info for the validated account.

Contact Creation

Case Creation





Here's more info from the Trailhead site re: flows.

Introduction to Visual Workflow, the Cloud Flow Designer and Flows


You may have heard several terms used interchangeably when referring to flows. Before we begin, let’s take a minute to define each of them and dispel some confusion.
  • Visual Workflow—the product that encompasses the process of designing, managing, and running flows. If you’re not sure about the difference between Visual Workflow and workflow rules, check out this help topic.
  • Cloud Flow Designer—a point-and-click tool that you can use to design flows.
  • Flow—an application that automates a process by collecting, updating, editing, and creating Salesforce data. Flows can execute logic, interact with the Salesforce database, call Apex classes, and guide users through screens for collecting and updating data. Most often, flows are built by using the Cloud Flow Designer.
In short, Visual Workflow is the product name, Cloud Flow Designer is the tool, and flows are the thing that you create...


Update 7/19/2016

When a created account doesn't pass the validation checks (duplicate account) then there's an error message after they hit the 'next' button.  This give no information as to why the account, case and contact we're created.

Adding an Error Message to the Flow

Because of the issue I mentioned above I've added an error message to the Flow. 

Here's the new layout. 



The first screen is the same as before.  Gather all of the info from the rep. 


The second screen is to assign all the entered fields from the rep as variables.  ie. Account Name = vAccountName


Then I'm looking up the account info based on the account name.  If the account's name = vAccountName (the name entered by the rep) then give me the AccountID


Next, if AccountID we searched for exists then we know this is going to trigger the duplicate error so let's let the rep change the name if they want. (typically they'd just stop here and go to the account in Salesforce instead).  


So, the next screen is simply a clone of the first with a notification that the account name was a duplicate name.  All the entry fields are suffixed with _0 now.

   

Since all the fields from the rep's entry are now suffixed with _0 we need to reassign them back to the variable they were before.  Using another Assignment allow us to reassign the populated fields back to the variables they were before. 


Checking again if the account is a duplicate. 

When there are no duplicates we're creating the records.  Records are getting created with the variables now though, not the entries from the rep directly like they were before. 



7/25/2016  Update

Added check that if country is US or Canada then the state/province needs to be populated.
And added check that all the other fields are populated too.



Marketing Flow to Delete Contacts and Create Lead records

Creating Flows and Processes.

Created a Process that kicks off a Flow.

The process runs when a contact record owned by one of the marketing reps is created or edited.  She shouldn't own any contacts but instead should own those contacts as leads.

The process starts a flow that grabs the contact ID from the triggered process, assigns many of the fields on the contact record as variables, deletes the contact record and then creates a lead record with the same info and assigns it to the same rep.



Process Overview



ID Contact Object in Process



Set Criteria



Launch Flow



Flow Overview



Contact Record Lookup




Account Record Lookup




Delete Contact Record




Create Lead Record





Collect Information from Users and then Operate on It with Visual Workflow