Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Free Learning
Arrow right icon
Salesforce CRM Admin Cookbook
Salesforce CRM Admin Cookbook

Salesforce CRM Admin Cookbook: Solutions to help you implement, configure, and customize your business applications with Salesforce CRM and Lightning Experience , Second Edition

eBook
€22.99 €32.99
Paperback
€41.99
Subscription
Free Trial
Renews at €18.99p/m

What do you get with a Packt Subscription?

Free for first 7 days. €18.99 p/m after that. Cancel any time!
Product feature icon Unlimited ad-free access to the largest independent learning library in tech. Access this title and thousands more!
Product feature icon 50+ new titles added per month, including many first-to-market concepts and exclusive early access to books as they are being written.
Product feature icon Innovative learning tools, including AI book assistants, code context explainers, and text-to-speech.
Product feature icon Thousands of reference materials covering every tech concept you need to stay up to date.
Subscribe now
View plans & pricing
Table of content icon View table of contents Preview book icon Preview Book

Salesforce CRM Admin Cookbook

Making a Picture Paint a Thousand Words...

In this chapter, we will cover the following recipes:

  • Showing overdue Opportunity close dates with a Salesforce image and formula field
  • Displaying Case Priority flags with Salesforce images and a formula field
  • Presenting account revenue indicators using custom images and a formula field
  • Measuring account credit scores graphically using a Google image chart
  • Building an account credit score graphically with code

Introduction

There is a saying that a picture paints a thousand words. Whether this is true, there is no doubt that pictures and images often, far better, describe information than words and numbers alone.

Text and numerical data can often be better represented as graphical charts and images to provide a quick and easy way to compare data values. Images can also provide a more visually powerful style of message delivery for what can otherwise be overlooked in static text or numbers.

In this chapter, we will provide recipes designed to enhance the user interface and provide features and functionality to visually display information in Salesforce CRM.

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:

Displaying Case Priority flags with Salesforce images and a formula field

The use of particular colors to represent certain states has become common place throughout the world. Red generally conveys danger and, in the ubiquitous traffic light signal, red means stop.

Continuing with the theme of traffic signal colors, and the use of red for stop, green for go, and yellow for proceed with caution, we can see how these colors can be used to represent statuses and to flag or highlight a current state or situation graphically.

Salesforce CRM contains images for red, yellow, and green flags.

In this recipe, we will display an image derived by a formula field that shows whether the Case Priority is high, medium, or low.

How to do it...

Carry out the following steps to create a formula field to display Salesforce images to graphically show the priority of case records:

  1. Click on the Setup gear icon in the top right-hand of the main Home page, as shown in the following screenshot:
  1. Click the Setup option, as shown in the following screenshot:
  1. Navigate to the Case customization setup page, by clicking the following: Objects and Fields | Object Manager | Case | 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 Priority Graphic 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 Priority_Graphic.
  3. Set the Formula Return Type as Text.
  4. Click Next.

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

  1. Paste the following code:
/*********************************************************** 

Priority Graphic for the Case, for High, Medium or Low. 

For high priority cases a red flag is displayed; for medium an orange is shown and for a low a green flag is shown. 

***********************************************************/ 

IMAGE  

(  

 IF( ISPICKVAL(Priority,"Low"), 

   "/img/samples/flag_green.gif",  

     IF( ISPICKVAL(Priority,"Medium"), 
       "/img/samples/flag_yellow.gif",  
         "/img/samples/flag_red.gif"  
       )  
       ), 
       "", 15, 15  
)
  1. Optionally, enter the following in the Description field:
Field to display an image according to whether the Case Priority is Low, Medium, or High 
  1. Optionally, enter the following in the Help Text field:
Field to display an image according to whether the Case Priority is Low, Medium, or High 
  1. In the Blank Field Handling section, select the option Treat blank fields.
  2. 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 case record formula field graphic is dynamically generated based on the selected priority value and appears on both case detail and edit pages.

You can see what this looks like when the case record Priority is set to Low in the following screenshot:

You can see what this looks like when the case record Priority is set to Medium in the following screenshot:

You can see what this looks like when the case record Priority is set to High in the following screenshot:

There's more...

The Priority Graphic 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 in the list view.

You can see what this looks like within a list view when the list of case records are either High, Medium, or Low for the PRIORITY GRAPHIC column, as shown in the following screenshot:

Presenting Account Revenue indicators using custom images and formula field

Increasingly on the web, we find sites that are using images of gold or silver stars to provide reviews and to rank the quality or usefulness of various products and services.

It has become universally accepted that one or no star equates to something very poor and five stars is seen to be excellent. By building an incremental number of images, we can create an associated image list of say one to five that conveys a rating and ranking factor.

For this recipe, we are using a dollar image that will be repeated depending on the value of the Account Revenue amount to show revenue graphically.

The dollar image we are using is a custom image and is not provided by the Salesforce CRM application.

Using the value entered in the standard field Account Revenue, we will create a custom formula field to build a set of images, from one to five, whenever the Account Revenue amount meets a certain threshold criteria.

The thresholds that will formulate are:

  • Greater than (or equal to) $100,000 = one dollar image
  • Greater than (or equal to) $500,000 = two dollar images
  • Greater than (or equal to) $1 million = three dollar images
  • Greater than (or equal to) $2 million = four dollar images
  • Greater than (or equal to) $5 million = five dollar images

Amounts less than $100,000 will have no images displayed.

Getting ready

In this recipe, we are going to display a repeating series of a custom image and we can either use an image file that we have created ourselves or use one obtained from an external source.

We will store the image file within Salesforce CRM as a Static Resource so we can maintain a copy and this will be referenced to enable the image to be displayed using a Salesforce formula field.

Carry out the following steps to upload an image file into Salesforce CRM as a Static Resource:

  1. Create or source a suitable image to represent a dollar symbol.
FamFamFam provides various images from its Silk Icons Library, available under the Creative Commons Attribution 2.5 License at http://www.famfamfam.com/lab/icons/silk/.
You can download the images which are contained in a ZIP file and then unzip the ZIP file to reveal the image files.
The image we have used in this recipe is a 16-by-16 pixel icon called money_dollar.png from http://www.famfamfam.comas shown in the following screenshot:

  1. Click on the Setup gear icon, as shown in the following screenshot:

The Setup gear icon is located in the top right-hand area of the main Home page.

  1. Click the Setup option, as shown in the following screenshot:
  1. Type the text static resources in the Quick Find search box, as shown in the following screenshot:
  1. Select the Static Resources option.
  2. Click on New, as shown in the following screenshot:
  1. In the resulting Static Resources page, enter the name of the Static Resource in the Name field.
  2. Enter the text money_dollar.
  3. Click on Choose File.
  4. Select the image to upload from your computer.
In this recipe, choose the image identified in Step 1. After selecting the image file, we will be presented with the Static Resources setup screen, as shown in the following screenshot:
Ignore the Cache Control picklist selection and leave it as default Private (Cache Control is only relevant to Static Resources used in http://www.Force.com sites).
  1. Click Save.
Static Resources allow us to upload images that we can reference within Salesforce CRM, such as from formula fields, Visualforce pages, and so on. This reference is a web URL and is formed as /resource/[UNIQUE ID]/money_dollar where the UNIQUE ID is a unique ID which is generated for every Static Resource and is unique throughout every Salesforce CRM system.

Now, to find the ID for the Static Resource uploaded previously, carry out the following steps:

  1. Click on the View file link, as shown in the following screenshot:
  1. Note the Web URL that is displayed in the browser address bar; this is the ID for the Static Resource, as shown in the following screenshot:
The URL that is generated is https://widgetsxyzlex-dev-ed--c.eu11.visual.force.com/resource/1505987107000/money_dollar?isdtp=p1.
You will now need to make a note of the URL that is shown in your Salesforce instance. This URL is specified for the reference to the image in a custom formula field that is used in this recipe using the steps shown in How to do it... section.

How to do it...

Carry out the following steps to create a formula field to display custom images that will reference the dollar image that was uploaded in the Getting ready section for this recipe:

  1. Click on the Setup gear icon in the top right-hand of the main Home page, as shown in the following screenshot:
  1. Click the Setup option, as shown in the following screenshot:
  1. Navigate to the Account customization setup page, by clicking the following: Objects and Fields | Object Manager | Account | 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, as shown in the following screenshot:
  1. Click Next.

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

  1. Type Account Revenue Graphic 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 Account_Revenue_Graphic.
  3. Set the Formula Return Type as Text.
  4. Click Next.

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

  1. Paste the following code in the formula edit box (as shown in the next image):
Remember to replace the URL shown with the URL from your Salesforce organization.
/********************************************************   

Begin the check for Annual Revenue value and set the following: 
Greater than (or equal to) 100,000 = One Dollar image  
Greater than (or equal to) 500,000 = Two Dollar image  
Greater than (or equal to) 1,000,000 = Three Dollar image 
Greater than (or equal to) 2,000,000 = Four Dollar image  
Greater than (or equal to) 5,000,000 = Five Dollar image  
*********************************************************/ 
IF( AnnualRevenue > 99999, IMAGE("/resource/1505987107000/money_dollar", "$", 16, 16),"") 
  & 
IF( AnnualRevenue > 499999, IMAGE("/resource/1505987107000/money_dollar", "$", 16, 16),"") 
  & 
IF( AnnualRevenue > 999999, IMAGE("/resource/1505987107000/money_dollar", "$", 16, 16),"") 
  & 
IF( AnnualRevenue > 1999999, IMAGE("/resource/1505987107000/money_dollar", "$", 16, 16),"") 
  & 
IF( AnnualRevenue > 4999999, IMAGE("/resource/1505987107000/money_dollar", "$", 16, 16),"")
  1. Optionally, enter the following in the Description field:

Greater than (or equal to) 100,000 = One Dollar image
Greater than (or equal to) 500,000 = Two Dollar image
Greater than (or equal to) 1,000,000 = Three Dollar image
Greater than (or equal to) 2,000,000 = Four Dollar image
Greater than (or equal to) 5,000,000 = Five Dollar image

  1. Optionally, enter the following in the Help Text field:

1 Dollar image = 100,000 or more
2 Dollar images = 500,000 or more
3 Dollar images = 1,000,000 or more
4 Dollar images = 2,000,000 or more
5 Dollar images = 5,000,000 or more

  1. In the Blank Field Handling section, select the option Treat blank fields.
  2. 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 the 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. Click Save.

How it works...

The formula field graphic is dynamically generated based on the annual revenue value and the rendered image appears on both the account record detail and edit pages.

You can see what this looks like when the Annual Revenue is set to $100,000, as shown in the following screenshot:

You can see what this looks like when the Annual Revenue is set to $50,000,000, as shown in the following screenshot:

There's more...

The Annual Revenue Graphic 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 in the list view.

You can see what this looks like within a list view when the list of account records are set to varying amounts for the ANNUAL REVENUE graphic column, as shown in the following screenshot:

Measuring account credit scores graphically using a Google image chart

This recipe shows the steps for rendering a credit score graphically using a Google Chart contained within a custom Salesforce CRM formula field. Here we are using a dial-type chart from Google called a Google-O-Meter chart.

Google provides various APIs for mapping functions, developer tools, graphical user interfaces, and so on. At the time of writing, the Google-O-Meter image chart is fully functioning for the purpose described in this recipe; however, Google APIs are subject to change and may become unsupported in the future.

The Google-O-Meter is a gauge that points toward a single value on a range. More details can be found at https://developers.google.com/chart/image/docs/gallery/googleometer_chart#introduction.

First, we create a custom account credit score which will feed the values rendered in the graphical range.

You can omit the steps in the following Getting ready section if you have previously carried out the steps in the Getting ready section of the Building an account credit score graphically with code recipe.

Getting ready

Carry out the following steps to create a custom Credit Score field on the Account object:

  1. Click on the Setup gear icon in the top right-hand of the main Home page, as shown in the following screenshot:
  1. Click the Setup option, as shown in the following screenshot:
  1. Navigate to the Account customization setup page, by clicking the following: Objects and Fields | Object Manager | Account | 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. Choose Number from the Data Type options.
  2. Click Next.

We will be presented with the Step 2. Enter the details page.

  1. Enter Credit Score in the Field Label.
  2. Enter 3 in the Length field.

Accept the default option of 0 in the Decimal Places field, as shown in the following screenshot:

  1. Optionally, enter a value in the Description field.
  2. Optionally, enter a value in the Help Text field.
  3. Click Next.

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

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

We will be presented with the Step 4. 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 to do it...

Carry out the following steps to create an account Credit Score formula field that uses the data contained in a custom field to display a Google Chart graphic:

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

We are presented with the Step 1. Choose the field type page.

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

We are presented with the Step 2. Choose output type page.

  1. Type Credit Score Graphic in the Field Label textbox.
  2. Click on the Field Name. When clicking out of the Field Label textbox, the Field Name is automatically filled with the value Credit_Score_Graphic.
  3. Set the Formula Return Type as Text.
  4. Click Next.

We are presented with the Step 3. Enter formula page.

  1. Paste the following code in the formula edit box (as shown in the next screenshot):
 
/*********************************************************** 

Google Chart type Google-O-meter 

  
***********************************************************/ 
IF( 
  ISNUMBER( TEXT(Credit_Score__c) ),  
    IMAGE(  
      "http://chart.apis.google.com/chart?cht=gm" & 
      "&chxl=0:|0|50|100&chxt=y&chs=200x120&chls=2|10" &  
      "&chd=t:" & TEXT((Credit_Score__c)) & 
      "&chl=" & TEXT(Credit_Score__c), "Credit Score Graphic" 
    ), 
  "Not Specified" 
)
  1. In the Blank Field Handling section, select the option Treat blank fields as blanks, as shown in the following screenshot:
  1. Optionally, enter a value in the Description field.
  2. Optionally, enter a value in the Help Text field.
  3. Click Next.

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

  1. Select the profiles to which you want to grant edit access to this field via the field-level security. The field will be hidden from all profiles if you do not add it to the 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...

Navigate to an account record page and enter the value 95 in the custom Credit Score number field. Upon saving, the account detail page displays the Credit Score Graphic image, as shown in the following screenshot:

Navigate to an account record page and enter the value 23 in the Credit Score number field. Upon saving, the account detail page displays the Credit Score Graphic image, as shown in the following screenshot:

Describing each part of the Google Chart code in the formula field gives the following:

/*********************************************************** 
Google Chart type Google-O-meter 
  
***********************************************************/ 
IF( 
  ISNUMBER( TEXT(Credit_Score__c) ),  
    IMAGE(  
      "https://chart.apis.google.com/chart?cht=gm" & 
      "&chxl=0:|0|50|100&chxt=y&chs=200x120&chls=2|10" &  
      "&chd=t:" & TEXT((Credit_Score__c)) & 
      "&chl=" & TEXT(Credit_Score__c), "Credit Score Graphic" 
    ), 
"Not Specified" 
) 

The comment section to describe the code in the formula is:

/*********************************************************** 
Google Chart type Google-O-meter 
  
***********************************************************/

Check that the Credit Score contains a number. If so, then continue to build the Google Chart code. If there is no valid number, then return the value Not Specified:

IF( 
  ISNUMBER( TEXT(Credit_Score__c) ),  
<.........................................> 
"Not Specified" 
) 

The Google Chart image construction is as follows:

    IMAGE(  
      "https://chart.apis.google.com/chart?cht=gm" & 
      "&chxl=0:|0|50|100&chxt=y&chs=200x120&chls=2|10" &  
      "&chd=t:" & TEXT((Credit_Score__c)) & 
      "&chl=" & TEXT(Credit_Score__c), "Credit Score Graphic" 
    ), 

Use the Google Chart URL https://chart.apis.google.com/chart?.
Specify the chart type gm (Google-O-Meter):

cht=gm 

Set the labels for the chart:

chxl=0:|0|50|100 

Specify using the y axis:

chxt=y 

Set the dimensions for the chart (width x height):

chs=200x120 

Specify the arrow line width and arrow head (2px line and small arrow head):

chls=2|10 

Set the data value passed to the graph (the data from the Credit Score field is passed):

chd=t:" & TEXT((Credit_Score__c)) 

Specify the data label on the chart (the data from the Credit Score field is passed):

chl=" & TEXT(Credit_Score__c)

There's more...

The Credit Score Graphic 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 account records is set with various scores on the CREDIT SCORE GRAPHIC column, as shown in the following screenshot:

Accessing Google Charts requires sending data from Salesforce over the internet so it is not secure. You should ensure only non-sensitive data is being sent.

Building an account credit score graphically with code

In this recipe, we will detail the steps to render an account credit score graphically using JavaScript and CSS within a Visualforce page.

We will add the Visualforce page as a component onto a Salesforce Account page using the Lightning App Builder and the image will appear on the main Account page as well as in the detail section of the page.

First, we create a custom Account Credit Score, which will feed the values rendered in the graphical range.

You can omit the steps in the following Getting ready section if you have previously carried out the steps in the Getting ready section of the Measuring account credit scores graphically using a Google image chart recipe.

Getting ready

Carry out the following steps to create a custom Credit Score field on the Account object:

  1. Click on the Setup gear icon in the top right-hand of the main Home page, as shown in the following screenshot:
  1. Click the Setup option, as shown in the following screenshot:
  1. Navigate to the Account customization setup page, by clicking the following: Objects and Fields | Object Manager | Account | 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. Choose Number from the Data Type options.
  2. Click Next.

We will be presented with the Step 2. Enter the details page.

  1. Enter Credit Score in the Field Label.
  2. Enter 3 in the Length field.
Accept the default option of 0 in the Decimal Places field, as shown in the following screenshot:
  1. Optionally, enter a value in the Description field.
  2. Optionally, enter a value in the Help Text field.
  3. Click Next.

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

  1. Select the profiles to which you want to grant edit access to this field via the 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 4. 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 to do it...

Carry out the following steps to create a Visualforce page along with HTML and JavaScript code that will render an account credit score graphically:

  1. Click on the Setup gear icon, as shown in the following screenshot:

The Setup gear icon is located in the top right-hand area of the main Home page.

  1. Click the Developer Console option, as shown in the following screenshot:
  1. In the resulting Developer Console window, click on File.
  2. Click on New.
  3. Click on the Visualforce Page, as shown in the following screenshot:

We will be presented with a New Apex Page dialog.

  1. Enter CreditScore for the name of your new Apex Page.
  2. Click on OK, as shown in the following screenshot:
  1. Paste the following code:
<apex:page standardController="Account"> 
<style> 
  td.no_border{border:none} 
  td.green{background-color:#00FF00; border:none} 
  td.red{background-color:#FF0000; border:none} 
  td.grey{background-color:#DDDDDD; border:none} 
</style>  
<script>  
  window.addEventListener('DOMContentLoaded', function() { 
    var iLimit = {!Account.Credit_Score__c}; 
    var sHTML ; 
    var iThreshold = 40; 
    sHTML = '<table>'; 
    sHTML += '<tr>'; 
    sHTML += '<td class="no_border">0%</td>';    
    for(var i=0; i<100; i=i+5){ 
      if( iLimit <= iThreshold ){ 
        if( i<iLimit ) 
          sHTML += '<td class="red" nowrap="nowrap">&nbsp;</td>'; 
         else 
          sHTML += '<td class="grey" nowrap="nowrap">&nbsp;
</td>'; }else{ if( i<iLimit ) sHTML += '<td class="green" nowrap="nowrap">&nbsp;
</td>'; else sHTML += '<td class="grey" nowrap="nowrap">&nbsp;
</td>'; } } sHTML += '<td class="no_border">100%</td></tr></table>'; if( iLimit >= 0 ){ document.getElementById("CreditScore").innerHTML = sHTML +
"Credit Score : " + iLimit + "%"; } }); </script> <div id="CreditScore">Credit Score is not within limits</div> </apex:page>

  1. Click on File.
  2. Click on Save, as shown in the following screenshot:

Now set the profile security and Lightning accessibility settings for the Visualforce page by carrying out the following steps:

  1. Click on the Setup gear icon, as shown in the following screenshot:

The Setup gear icon is located in the top right-hand area of the main Home page.

  1. Click the Setup option, as shown in the following screenshot:
  1. Type the text visualforce in the Quick Find search box, as shown in the following screenshot:
  1. Click on Visualforce Pages.
  2. Click on Security for the CreditScore Visualforce Page.
  3. Click on Save.
  4. Click on Edit.
  5. Check the Available for Lightning Experience, Lightning Communities, and the mobile app checkbox.

 

  1. Click on Save, as shown in the following screenshot:
  1. Navigate to an Accounts page.
  2. Click on the Setup gear icon.

The Setup gear icon is located in the top right-hand area of the Account page.

  1. Click on Edit Page, as shown in the following screenshot:

After having clicked Edit Page, you will be presented with the Lightning App Builder screen for the Account page, as shown in the following screenshot:

  1. Drag the Visualforce component from the left-hand components pane to the canvas in the top right position.
  2. Select CreditScore in the Visualforce Page Name.
  3. Type Financial Assessment for the Label.
  4. Set the Height (in pixels) field to 50.
  5. Click on Save.
  6. Click on Activation..., as shown in the following screenshot:

If this is the first time you have saved the Account page, instead of the previous step, you will have been presented with a Page Saved dialog. In this scenario, carry out the following steps:

  1. Click on Activate, as shown in the following screenshot:
  2. Click on Assign as Org Default, as shown in the following screenshot:
  3. Click on Save, as shown in the following screenshot:

How it works...

Find an account record and within the Account detail page, enter the value 85 in the custom Credit Score number field.

Navigate from the detail page to the main Account page and refresh the page to reveal the Credit Score image of 85% in the top-right section, as shown in the following screenshot:

Find an account record and, within the Account detail page, enter the value 40 in the custom Credit Score number field.

Navigate from the detail page to the main account page and refresh the page to reveal the Credit Score image of 40% in the top-right section, as shown in the following screenshot:

Left arrow icon Right arrow icon

Key benefits

  • • Implement advanced user interface techniques to improve the look and feel of Salesforce CRM.
  • • Discover hidden features and hacks that extend standard configuration to provide enhanced functionality and customization.
  • • Build real-world process automation using detailed recipes to harness the full power of Salesforce CRM.

Description

Salesforce CRM is a market-leading customer relationship management (CRM) application that is accessed over the internet. This application greatly enhances a company's sales performance, improves customer satisfaction, and provides a robust customer relationship management system for an organization. Salesforce CRM Admin Cookbook, Second Edition enables you to instantly extend and unleash the power of Salesforce CRM and its Lightning Experience framework. It provides clear, comprehensive instructions along with detailed screenshots and code. Whether you are looking for solutions to enhance the core features, such as data management, process automation, data validation, and home page administration, or are looking for ideas on advanced customization techniques, this book will provide you with immediate, practical, and exciting real-world recipes. This book guides you through interesting topics spanning a variety of functional areas. Recipes are provided that allow you to configure, build and extend the capability of Salesforce CRM using the Lightning Experience framework.

Who is this book for?

If you are a system administrator interested in developing and enhancing your skills with data management, process automation and security enhancements with SalesforceCRM, then this book is for you. Some basic understanding of SalesforceCRM and system administration knowledge would be needed.

What you will learn

  • Building home page components and creating custom links to provide additional functionality and improve the Home Tab layout
  • Improving the look and feel of Salesforce CRM with the presentation of graphical elements using advanced user interface techniques
  • Improving the data quality in Salesforce CRM and automatic data capture
  • Implement an approval process to control the way approvals are managed for records in Salesforce CRM
  • Increase productivity using tools and features to provide advanced administration
  • Extend Lightning Experience Record Pages to tailor user interaction experience
  • Create Lightning component to implement Search before Create for customer/person accounts

Product Details

Country selected
Publication date, Length, Edition, Language, ISBN-13
Publication date : Dec 22, 2017
Length: 358 pages
Edition : 2nd
Language : English
ISBN-13 : 9781788625517
Category :
Concepts :
Tools :

What do you get with a Packt Subscription?

Free for first 7 days. €18.99 p/m after that. Cancel any time!
Product feature icon Unlimited ad-free access to the largest independent learning library in tech. Access this title and thousands more!
Product feature icon 50+ new titles added per month, including many first-to-market concepts and exclusive early access to books as they are being written.
Product feature icon Innovative learning tools, including AI book assistants, code context explainers, and text-to-speech.
Product feature icon Thousands of reference materials covering every tech concept you need to stay up to date.
Subscribe now
View plans & pricing

Product Details

Publication date : Dec 22, 2017
Length: 358 pages
Edition : 2nd
Language : English
ISBN-13 : 9781788625517
Category :
Concepts :
Tools :

Packt Subscriptions

See our plans and pricing
Modal Close icon
€18.99 billed monthly
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Simple pricing, no contract
€189.99 billed annually
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Choose a DRM-free eBook or Video every month to keep
Feature tick icon PLUS own as many other DRM-free eBooks or Videos as you like for just €5 each
Feature tick icon Exclusive print discounts
€264.99 billed in 18 months
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Choose a DRM-free eBook or Video every month to keep
Feature tick icon PLUS own as many other DRM-free eBooks or Videos as you like for just €5 each
Feature tick icon Exclusive print discounts

Frequently bought together


Stars icon
Total 125.97
Salesforce CRM Admin Cookbook
€41.99
Salesforce Lightning Reporting and Dashboards
€41.99
Learning Salesforce Visual Workflow and Process Builder
€41.99
Total 125.97 Stars icon
Banner background image

Table of Contents

8 Chapters
Making a Picture Paint a Thousand Words... Chevron down icon Chevron up icon
Salesforce CRM&#x27;s Home Page is Where the Heart is... Chevron down icon Chevron up icon
Automating Work with Salesforce CRM Chevron down icon Chevron up icon
Improving Data Quality in Salesforce CRM Chevron down icon Chevron up icon
Implementing Approval Processes Chevron down icon Chevron up icon
Productivity Tools for Superusers and Advanced Administration Chevron down icon Chevron up icon
Extending Lightning Experience Record Pages Chevron down icon Chevron up icon
Building a Search-First-Before-You-Create Lightning Component Chevron down icon Chevron up icon

Customer reviews

Rating distribution
Full star icon Full star icon Half star icon Empty star icon Empty star icon 2.8
(5 Ratings)
5 star 40%
4 star 0%
3 star 0%
2 star 20%
1 star 40%
Antonina Apr 22, 2018
Full star icon Full star icon Full star icon Full star icon Full star icon 5
A great book for both new and experienced Salesforce Admins. The book is very well structured and all concepts are explained clearly. What I like the most is that all excercises are concentrated around real-life scenarios applicable to most companies that use Salesforce. In addition to this while many other books still teach how to do things in classic, this book is all about Lightning. Whether you are new to Salesforce or consider switching to Lightning, I recommend reading this book.
Amazon Verified review Amazon
Trevor Lobel Apr 12, 2018
Full star icon Full star icon Full star icon Full star icon Full star icon 5
Once again an outstanding book from Paul. Clear, concise, packed full of very valuable and relevant information. Highly recommended !
Amazon Verified review Amazon
Jon May 14, 2019
Full star icon Full star icon Empty star icon Empty star icon Empty star icon 2
Half of the book is covered with screenshot images and instructions. The examples are very trivial and repetitive. You can learn all this stuff online and find better explanations there.
Amazon Verified review Amazon
Robby Oct 24, 2018
Full star icon Empty star icon Empty star icon Empty star icon Empty star icon 1
(This as of 2018-10-24) - Hmmm... Both reviews don't have "Verified Purchase" and sound like friends of the author... And why isn't there any preview of this book, or even the Table of Contents isn't provided? $40 bucks is pretty steep for a book that doesn't let you see what's inside. Till then, I'm not going to risk $40 on blind faith. @Author - Add a preview and I will change this review...
Amazon Verified review Amazon
Cliente de Amazon May 20, 2022
Full star icon Empty star icon Empty star icon Empty star icon Empty star icon 1
Too much theory
Amazon Verified review Amazon
Get free access to Packt library with over 7500+ books and video courses for 7 days!
Start Free Trial

FAQs

What is included in a Packt subscription? Chevron down icon Chevron up icon

A subscription provides you with full access to view all Packt and licnesed content online, this includes exclusive access to Early Access titles. Depending on the tier chosen you can also earn credits and discounts to use for owning content

How can I cancel my subscription? Chevron down icon Chevron up icon

To cancel your subscription with us simply go to the account page - found in the top right of the page or at https://subscription.packtpub.com/my-account/subscription - From here you will see the ‘cancel subscription’ button in the grey box with your subscription information in.

What are credits? Chevron down icon Chevron up icon

Credits can be earned from reading 40 section of any title within the payment cycle - a month starting from the day of subscription payment. You also earn a Credit every month if you subscribe to our annual or 18 month plans. Credits can be used to buy books DRM free, the same way that you would pay for a book. Your credits can be found in the subscription homepage - subscription.packtpub.com - clicking on ‘the my’ library dropdown and selecting ‘credits’.

What happens if an Early Access Course is cancelled? Chevron down icon Chevron up icon

Projects are rarely cancelled, but sometimes it's unavoidable. If an Early Access course is cancelled or excessively delayed, you can exchange your purchase for another course. For further details, please contact us here.

Where can I send feedback about an Early Access title? Chevron down icon Chevron up icon

If you have any feedback about the product you're reading, or Early Access in general, then please fill out a contact form here and we'll make sure the feedback gets to the right team. 

Can I download the code files for Early Access titles? Chevron down icon Chevron up icon

We try to ensure that all books in Early Access have code available to use, download, and fork on GitHub. This helps us be more agile in the development of the book, and helps keep the often changing code base of new versions and new technologies as up to date as possible. Unfortunately, however, there will be rare cases when it is not possible for us to have downloadable code samples available until publication.

When we publish the book, the code files will also be available to download from the Packt website.

How accurate is the publication date? Chevron down icon Chevron up icon

The publication date is as accurate as we can be at any point in the project. Unfortunately, delays can happen. Often those delays are out of our control, such as changes to the technology code base or delays in the tech release. We do our best to give you an accurate estimate of the publication date at any given time, and as more chapters are delivered, the more accurate the delivery date will become.

How will I know when new chapters are ready? Chevron down icon Chevron up icon

We'll let you know every time there has been an update to a course that you've bought in Early Access. You'll get an email to let you know there has been a new chapter, or a change to a previous chapter. The new chapters are automatically added to your account, so you can also check back there any time you're ready and download or read them online.

I am a Packt subscriber, do I get Early Access? Chevron down icon Chevron up icon

Yes, all Early Access content is fully available through your subscription. You will need to have a paid for or active trial subscription in order to access all titles.

How is Early Access delivered? Chevron down icon Chevron up icon

Early Access is currently only available as a PDF or through our online reader. As we make changes or add new chapters, the files in your Packt account will be updated so you can download them again or view them online immediately.

How do I buy Early Access content? Chevron down icon Chevron up icon

Early Access is a way of us getting our content to you quicker, but the method of buying the Early Access course is still the same. Just find the course you want to buy, go through the check-out steps, and you’ll get a confirmation email from us with information and a link to the relevant Early Access courses.

What is Early Access? Chevron down icon Chevron up icon

Keeping up to date with the latest technology is difficult; new versions, new frameworks, new techniques. This feature gives you a head-start to our content, as it's being created. With Early Access you'll receive each chapter as it's written, and get regular updates throughout the product's development, as well as the final course as soon as it's ready.We created Early Access as a means of giving you the information you need, as soon as it's available. As we go through the process of developing a course, 99% of it can be ready but we can't publish until that last 1% falls in to place. Early Access helps to unlock the potential of our content early, to help you start your learning when you need it most. You not only get access to every chapter as it's delivered, edited, and updated, but you'll also get the finalized, DRM-free product to download in any format you want when it's published. As a member of Packt, you'll also be eligible for our exclusive offers, including a free course every day, and discounts on new and popular titles.