Site Users – Session Based Permission Sets

Business Need: Skeletonforce Corporation has been using a sites page to allow both Salesforce and non-Salesforce employees to submit REFERRALS to employees across various lines of business. All referrals have come from the site page. The business wants to reduce manual data entry and allow referrals to be generated from an Account Page.

Identified Issue: Unlike the Site Guest User, the line of business users are not assigned the various record types needed to generate referrals across the corporation. The businesses have also decided they do not want allow the risk of assigning their users access to the record types.

Solution: A session based permission sets can be assigned with the Referral flow to allow their permissions to be extended within the context of the flow session.

Create a permission set to give permission to the various objects, fields and record types need in the referral process. Make sure to indicate the permission set requires Session Activation.

SessionBasedPS

Remember – In order for the permission set to be assigned to a user in a flow session, the user must already be assigned to the permission set.

Flow Element: A flow elements is added to the flow to activate the permissions. Use the Developer Name in the Permission Set Name field. A similar Deactivate Permission set is need to turn off the permission set.

ActivateSessionBasedPS

Testing reveals the admin needs to account for the fact Site Guest Users Do Not Generate a Session Id. Instead, it will return NULL_SESSION_ID.

To account for this, a formula needs to used to determine if a session id is present or NULL_SESSION_ID. The session id is assigned to a variable. If a session id exists, then the flow was triggered by a user within the Salesforce instance.

A decision is used to either assign the new permission set to the user. If the variable equals NULL_SESSION_ID then this means the flow was triggered by the guest user. SessionPSFlow

 

 

#Be A Builder – Creating Reports and Dashboards

 

Key Takeaways:

  • Build reusable custom report to feed all your dashboard components #OneReportToRuleEmAll
  • Enable Dashboard feed for collaboration and optimization
  • View and refine important data with filters

Day 9: Create Reports and Dashboards:

  1. Understand the business problem you are trying to solve
    1. Meet with Stakeholders
    2. Understand what is important to the managers
  2. Creating one report to rule them all
    1. Reduce maintenance
    2. One data source to track down
  3. One dashboard to can be used for many solutions
    1. Key KPI’s components should appear at the top
    2. Customize components to meet individual group needs
    3. Start with many components with the same data presented in different ways
    4. Add Filters
      1. Time
      2. Geographical location
  4. Get feedback from Users using Feed
    1. Fine tune with Users
      1. Surveys

 

 

 

#Be A Builder – Leverage AppExchange & Components

Key Takeaways

  • First Customize with standard components
  • Explore and Install AppExchange components
  • Build Custom lightning Components to address your customization needs

Day 8 – Leverage AppExchange & Components

Start with the components that are already available

  • Path
  • Rich Text Field
  • Conditionally show hide
  • Related Record
  • Report Charts

Next Review the AppExchange for apps that add functionality to fulfill the applications business requirements

  1. Define what functionality the AppExchange app need to accomplish
  2. Install into a developer org to review how the application interacts with core Salesforce components.
    1. Pay particular attention to how the app is going to interact with your app.
    2. Determine any changes needed to work within your app.
    3. Measure the amount of work/changes needed against the functionality gain to  determine of the AppExchange app is worth installing.

Exploring building custom components if you cannot find a suitable app on the AppExchange

#Be A Builder – Add Automation

Day 7 – #Be A Builder – Define Permissions

Day 7 – Add Automation

  • Key Takeaways
    • Use automation to reduce manual data entry, create reminders and save time
    • Consider the automation funnel when choosing the right automation tool
    • Process builder is always first consideration
  • Business Requirements: Automatically Populate data to maintain good data quality
    • Start Date
    • End Date
    • How many projects have been completed for each account
  • Automation Funnel
    1. Can this be done with Process Builder
    2. Can this be done with a flow
    3. Can this be done with code

Process Builder:

  • Object – Project
    • New or Edited
    • Nodes
      • NEW:
        • Business Requirement: Automatically populate Start Date
        • isnew()
          • Immediate Action
            • Field Update – Start Date
              • Formula: Today ()
      • Status is closed
        • Business Requirement: Automatically populate End Date
        • Status equals “Closed”
          • Immediate Action
            • FIeld Update – End Date
              • Formula: Today()

Flow:

Possible Solution – Each time a project is closed a flow could be used to update and count all closed project related to the current project’s account. Populate the count into the Completed Project field.

  • Collection Sobject – Projects related to Account
  • Variable -varCompletedProjects
  • Loop
    • Count each record n collection
  • Fast Update – Account Completed Projects

Code:

Possible Solution – After Update Trigger: Each time a project is edited count all closed project related to the current project’s account and populate the count into the Completed Projects field.

/**
* Populate account field Completed_Projects__c with count of related projects with status=closed
**/
trigger ProjectTrigger on Project__c (after delete, after insert, after update) {

Set accountIds = new Set();

if (Trigger.isUpdate || Trigger.isDelete) {
for (Project__c proj : Trigger.old){
accountIds.add(proj.Account__c);
}
}

Map<Id,Account> accountMap = new Map<Id,Account>(
[SELECT id, Completed_Projects__c,
(SELECT Id, Status__c, End_Date__c
FROM Projects__r
WHERE Status__c = ‘closed’)
FROM Account
WHERE Id IN :accountIds]);

if(!accountMap.isEmpty()){
for (Account acc : accountMap.values()) {
Integer completeProj = 0;
for (Project__c p : acc.Projects__r){
if (p.Status__c == ‘closed’){
completeProj++;
}
}
accountMap.get(acc.Id).Completed_Projects__c = completeProj;
}
}

if (accountMap.size() > 0) {
update accountMap.values();
}

}

#Be A Builder – Define Permissions

Be A Builder – Defining Permissions

Day 6 — Security – Defining Permissions

  • Defining user level access using custom app and user permissions – (Who see what)
    • Key Takeaways
      • Grant User access to new custom app
      • Define app access fo project users with custom profile
      • App access for other types of users with permission sets
    • Resources

Make A Plan:

User Items Access Granted by Access Level Data Access
Project Users
  • Custom App
    • Project Central
  • Objects
  • Field Level Security
  • Custom Profile
  • Read
  • Create
  • Edit
  • Modify All
Sales Users
  • Custom App
    • Project Central
  • Objects
  • Field Level Security
  •  Permission Set:
    • Project Viewer
  • Read
  •  View All
  • TESTING as A USER to Make sure they have the app they need to use the app

#Be A Builder – Accurate Data

Ensuring the app maintain accurate data

“App is only as good as its Data”

Increase data quality by reducing manual data entry, surfacing data automatically and to make reporting easier.

  1. New Fields
    1. Account Number (Formula Field)
      1. Purpose
        1. Reduce manually entered and error prone data
    2. Project Health
      1. Purpose
        1. Data Consistency
        2. More intuitive reporting
      2.  Values
        1. Red – Business Stopping
        2. Yellow – Need Assistance
        3. Green – On Track
  2. Validation Rules
    1. Enforce users will meet business expectations and process
      1. Status Updates
        1. Purpose
          1. Enforce user can only update project status descriptions from when the project changes status
        2. Formula
          1. AND(
            ISBLANK(Description__c),
            ISPICKVAL(Status__c, “In Progress”)
            )
        3. Error Message
          1. Please add a description if you are going to start working on this project

 

#Be A Builder – User Interface

 

Building an Awesome User Experience

  1. Lightning App
    1. App Details & Branding
      1. App Name
      2. Descrioption
      3. Logo
      4. Branding Color
    2. Utility Bar
      1. Items users can utilize no matter where they all in Salesforce
      2. Included Item (Standard and Custom Components)
        1. Recent Accounts
        2. Recent Projects
    3. Selected Items to include in the App
      1. Project
      2. Account
      3. Calendar
      4. Chatter
      5. Dashboard
      6. Reports
    4. Assignments
  2. Lighting App Builder – Lightning Page
    1. Surface the most important information with the fewest amount of clicks
      1. Add tabs to control how much information is on the page
        1. Details
        2. Files (single related list)
        3. Chatter
        4. Activities
      2. Custom Lightning Components
        1. Photo Carousel
      3. Path Component
        1. Helps coach user
          1. Steps to manage  a project related to status
    2. Assign to Teams

Day4