/
Actions Examples

Actions Examples

Follow Up

Only create this for orgs that are going to use Tasks. I hate tasks, so check out Action Views, Tasks and Report Alerts for some alternatives. But some people like tasks, so this is a quick way to get them to add a follow up task. I create these for each object that is requried, rather than Global so that the related to is prefilled. And you can still use this to create regular tasks just by changing the values. 

The settings

The Predefined Field Values - Due Date Today()+2 - change it to what ever works for your org. 

The Layout - everything except what is likely to be changed is deleted. 


The end result

Mini Field Details Panel

Create an Action

  • Make it an Update Record Action (even if there are no fields on the Action that you will update). 
  • Give it a consistent API Name, like DisplABC, or DisplXYZ - so you know this Action is only used for Display, or FeildsStatus if this is for a subset of fields. (You can put a meaningful Label on the Page when you add it to the Page. 

  • Edit the Layout, remove all the fields
  • Add the fields you want to show on the component. 
  • Save the Quick Action  and ignore the warning message that you need the required fields to save the record. 

  • No need to set any pre-defined fields. 
  • Now go to the Lightning Page, Add the Related Record Component
  • Enter a Header Label
  • Choose the Update Action

  • Then set the Component Visibility using the criteria you want. 
  • Note, you may have to create a formula field to get the right criteria. Also keep a good naming convention for those - eg DisplText or similar. 

Use Cases

Rarely used fields

Rather than have a different page layout for 3 fields on a different Record Type, add those three fields to an Action and RRC, and then create a formula field as to when they should be displayed, and have that RRC display only when it's needed. 

Eg, in this Case SLA fields - only show if the Account has an SLA. 

Fields only displayed at certain stages

In the old days, you had to create a Record Type and a page layout, and then do a workflow field update to change the page layout to match the record type if a Stage changes that needs additional fields. Now with a Conditional RRC, you don't need that anymore. It's probably only a bit less set up work, but I hope easier to maintain in the long run. 

Eg, in this case, only show the Report Hyperlinks if the Status is Complete. 

HYPERLINK("#/sObject/00OB0000001cGVQMA2/view?fv0=" & Id, "Report Hyperlink")

Buttons, Indicators, and Emojis!

Buttons and visual indicators are a great way of highlighting key details on a page.

Yes, you can highlight key fields in the Compact Layout, but as the Compact layout is next to useless, and apparently not going to change (as per a comment from one of the Salesforce people at the Lightning Now tour last year) you are going to probably want a more flexible approach. 

So spice up your pages with key visual fields that really mean something to your users, and allows them to see at a glance what is happening. 

Examples

Emoji

IF(ISPICKVAL(Industry,"Agriculture"), "🥑",IF(ISPICKVAL(Industry,"Consulting"),"💩","🐵"))

(yeah, it's not a good formula, but you get the idea, you just copy and paste Emojis in instead of text). Notice the bug on the layout that shifts the last field over a bit.
 

Progress Bar

IMAGE("/resource/Colours/green.png","png",10,((100/60)*50)) & 
IMAGE("/resource/Colours/neutral-2.png","neutral",10,((100/40)*50)) & 
" 40%"

Of course replace the numbers with fields. 50 is the width in pixels. Replace the Text with the field value as text also. 

Thanks to Christian Carter for this idea and the great colour swatches. 

  • You could add multiple Progress bars to the same image formua field otherwise it will be too spaced out on the Component. 
Button

IMAGE("http://dabuttonfactory.com/button.png?t=" & TEXT(Ownership) &"&f=Open+Sans-Bold&ts=14&tc=fff&hp=16&vp=8&c=5&bgt=unicolored&bgc=0070d2&bs=1&bc=569",TEXT(Ownership))
Thanks to Christian Carter for working out the buttons that look good on Lightning. But this might look