Search icon CANCEL
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Salesforce CRM Admin Cookbook

You're reading from   Salesforce CRM Admin Cookbook Solutions to help you implement, configure, and customize your business applications with Salesforce CRM and Lightning Experience

Arrow left icon
Product type Paperback
Published in Dec 2017
Publisher
ISBN-13 9781788625517
Length 358 pages
Edition 2nd Edition
Concepts
Arrow right icon
Author (1):
Arrow left icon
Paul Goodey Paul Goodey
Author Profile Icon Paul Goodey
Paul Goodey
Arrow right icon
View More author details
Toc

Table of Contents (9) Chapters Close

Preface 1. Making a Picture Paint a Thousand Words... FREE CHAPTER 2. Salesforce CRM's Home Page is Where the Heart is... 3. Automating Work with Salesforce CRM 4. Improving Data Quality in Salesforce CRM 5. Implementing Approval Processes 6. Productivity Tools for Superusers and Advanced Administration 7. Extending Lightning Experience Record Pages 8. Building a Search-First-Before-You-Create Lightning Component

Showing overdue Opportunity close dates with a Salesforce image and formula field

The use of exclamation, and check icons is a common sight within applications and helps to clearly show where data or processes are either satisfactory or in need of amendment.

Using an exclamation icon we can show where Opportunity close dates are overdue and need to be updated in Salesforce. We can use a check icon to show that all is well and no action is required.

Salesforce CRM contains images for various flags and icons.

In this recipe, we will display an image derived by a formula field that shows whether the Opportunity close date is within date or is overdue.

How to do it...

Carry out the following steps to create a formula field to display Salesforce images to show graphically whether the close date is overdue or within date for Opportunity records:

  1. Click on the Setup gear icon in the top right-hand of the main Home page, as shown in the following screenshot:
  2. Click the Setup option, as shown in the following screenshot:
  1. Navigate to the Opportunity customization setup page, by clicking the following: Objects and Fields | Object Manager | Opportunity | Fields and Relationships.

Locate the Fields & Relationships section on the right of the page.

  1. Click New.

We will be presented with the Step 1. Choose the field type page.

  1. Select the Formula option.
  2. Click Next.

We will be presented with the Step 2. Choose output type page.

  1. Type Close Date Valid in the Field Label text box.
  2. Click on the Field Name. When clicking out of the Field Label text box, the Field Name is automatically filled with the value Close_Date_Valid.

 

  1. Set the Formula Return Type as Text.
  2. Click Next.

We will be presented with the Step 3. Enter formula page.

  1. Paste the following code:
/***********************************************************  
Warning Graphic for the Opportunity.  
If the Close Date has been reached display a warning  
***********************************************************/  
IMAGE(  
  IF(  
    AND(  
      NOT(IsClosed),  
      CloseDate < TODAY()),
      "/img/msg_icons/warning32.png",  
      "/img/msg_icons/confirm32.png"),  
      "", 15, 15) 
  1. Optionally, enter the following in the Description field:
 Field to display an image according to whether
the Close Date is overdue or within date
  1. Optionally, enter the following in the Help Text field:
 Field to display an image according to whether
the Close Date is overdue or within date
  1. In the Blank Field Handling section, select the option Treat blank fields as blanks.

 

  1. Click Next, as shown in the following screenshot:

We will be presented with the Step 4. Establish field-level security page.

  1. Select the profiles to which you want to grant read access to this field via field-level security. The field will be hidden from all profiles if you do not add it to field-level security.
  2. Click Next.

We will be presented with the Step 5. Add to page layouts page.

  1. Select the page layouts that should include this field. The field will be added as the last field in the first two column section of these page layouts. The field will not appear on any pages if you do not select a layout.
  2. Finally, click Save.

How it works...

The Opportunity record formula field graphic is dynamically generated based on whether the Close Date is within date or overdue and appears on both opportunity detail and edit pages.

You can see what this looks like when the Close Date for an opportunity record is overdue in the following screenshot:

You can see what this looks like when the Close Date for an opportunity record is within date in the following screenshot:

There's more...

The Close Date Valid formula image field is not only shown when the record is being viewed or edited but can also be seen when you include the field in a list view.

Formula fields containing an image can also be sorted on in the list view.

You can see what this looks like within a list view when the list of opportunity records are either overdue or within date for the CLOSE DATE VALID column, as shown in the following screenshot:

You have been reading a chapter from
Salesforce CRM Admin Cookbook - Second Edition
Published in: Dec 2017
Publisher:
ISBN-13: 9781788625517
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at €18.99/month. Cancel anytime