Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Save more on your purchases now! discount-offer-chevron-icon
Savings automatically calculated. No voucher code required.
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
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
$29.99 $43.99
Paperback
$54.99
Subscription
Free Trial
Renews at $19.99p/m

What do you get with Print?

Product feature icon Instant access to your digital eBook copy whilst your Print order is Shipped
Product feature icon Paperback book shipped to your preferred address
Product feature icon Download this book in EPUB and PDF formats
Product feature icon Access this title in our online reader with advanced features
Product feature icon DRM FREE - Read whenever, wherever and however you want
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
Estimated delivery fee Deliver to Taiwan

Standard delivery 10 - 13 business days

$12.95

Premium delivery 5 - 8 business days

$45.95
(Includes tracking information)

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 Print?

Product feature icon Instant access to your digital eBook copy whilst your Print order is Shipped
Product feature icon Paperback book shipped to your preferred address
Product feature icon Download this book in EPUB and PDF formats
Product feature icon Access this title in our online reader with advanced features
Product feature icon DRM FREE - Read whenever, wherever and however you want
Estimated delivery fee Deliver to Taiwan

Standard delivery 10 - 13 business days

$12.95

Premium delivery 5 - 8 business days

$45.95
(Includes tracking information)

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
$19.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
$199.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
$279.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 $ 164.97
Salesforce CRM Admin Cookbook
$54.99
Salesforce Lightning Reporting and Dashboards
$54.99
Learning Salesforce Visual Workflow and Process Builder
$54.99
Total $ 164.97 Stars icon

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%
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
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
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
Get free access to Packt library with over 7500+ books and video courses for 7 days!
Start Free Trial

FAQs

What is the delivery time and cost of print book? Chevron down icon Chevron up icon

Shipping Details

USA:

'

Economy: Delivery to most addresses in the US within 10-15 business days

Premium: Trackable Delivery to most addresses in the US within 3-8 business days

UK:

Economy: Delivery to most addresses in the U.K. within 7-9 business days.
Shipments are not trackable

Premium: Trackable delivery to most addresses in the U.K. within 3-4 business days!
Add one extra business day for deliveries to Northern Ireland and Scottish Highlands and islands

EU:

Premium: Trackable delivery to most EU destinations within 4-9 business days.

Australia:

Economy: Can deliver to P. O. Boxes and private residences.
Trackable service with delivery to addresses in Australia only.
Delivery time ranges from 7-9 business days for VIC and 8-10 business days for Interstate metro
Delivery time is up to 15 business days for remote areas of WA, NT & QLD.

Premium: Delivery to addresses in Australia only
Trackable delivery to most P. O. Boxes and private residences in Australia within 4-5 days based on the distance to a destination following dispatch.

India:

Premium: Delivery to most Indian addresses within 5-6 business days

Rest of the World:

Premium: Countries in the American continent: Trackable delivery to most countries within 4-7 business days

Asia:

Premium: Delivery to most Asian addresses within 5-9 business days

Disclaimer:
All orders received before 5 PM U.K time would start printing from the next business day. So the estimated delivery times start from the next day as well. Orders received after 5 PM U.K time (in our internal systems) on a business day or anytime on the weekend will begin printing the second to next business day. For example, an order placed at 11 AM today will begin printing tomorrow, whereas an order placed at 9 PM tonight will begin printing the day after tomorrow.


Unfortunately, due to several restrictions, we are unable to ship to the following countries:

  1. Afghanistan
  2. American Samoa
  3. Belarus
  4. Brunei Darussalam
  5. Central African Republic
  6. The Democratic Republic of Congo
  7. Eritrea
  8. Guinea-bissau
  9. Iran
  10. Lebanon
  11. Libiya Arab Jamahriya
  12. Somalia
  13. Sudan
  14. Russian Federation
  15. Syrian Arab Republic
  16. Ukraine
  17. Venezuela
What is custom duty/charge? Chevron down icon Chevron up icon

Customs duty are charges levied on goods when they cross international borders. It is a tax that is imposed on imported goods. These duties are charged by special authorities and bodies created by local governments and are meant to protect local industries, economies, and businesses.

Do I have to pay customs charges for the print book order? Chevron down icon Chevron up icon

The orders shipped to the countries that are listed under EU27 will not bear custom charges. They are paid by Packt as part of the order.

List of EU27 countries: www.gov.uk/eu-eea:

A custom duty or localized taxes may be applicable on the shipment and would be charged by the recipient country outside of the EU27 which should be paid by the customer and these duties are not included in the shipping charges been charged on the order.

How do I know my custom duty charges? Chevron down icon Chevron up icon

The amount of duty payable varies greatly depending on the imported goods, the country of origin and several other factors like the total invoice amount or dimensions like weight, and other such criteria applicable in your country.

For example:

  • If you live in Mexico, and the declared value of your ordered items is over $ 50, for you to receive a package, you will have to pay additional import tax of 19% which will be $ 9.50 to the courier service.
  • Whereas if you live in Turkey, and the declared value of your ordered items is over € 22, for you to receive a package, you will have to pay additional import tax of 18% which will be € 3.96 to the courier service.
How can I cancel my order? Chevron down icon Chevron up icon

Cancellation Policy for Published Printed Books:

You can cancel any order within 1 hour of placing the order. Simply contact customercare@packt.com with your order details or payment transaction id. If your order has already started the shipment process, we will do our best to stop it. However, if it is already on the way to you then when you receive it, you can contact us at customercare@packt.com using the returns and refund process.

Please understand that Packt Publishing cannot provide refunds or cancel any order except for the cases described in our Return Policy (i.e. Packt Publishing agrees to replace your printed book because it arrives damaged or material defect in book), Packt Publishing will not accept returns.

What is your returns and refunds policy? Chevron down icon Chevron up icon

Return Policy:

We want you to be happy with your purchase from Packtpub.com. We will not hassle you with returning print books to us. If the print book you receive from us is incorrect, damaged, doesn't work or is unacceptably late, please contact Customer Relations Team on customercare@packt.com with the order number and issue details as explained below:

  1. If you ordered (eBook, Video or Print Book) incorrectly or accidentally, please contact Customer Relations Team on customercare@packt.com within one hour of placing the order and we will replace/refund you the item cost.
  2. Sadly, if your eBook or Video file is faulty or a fault occurs during the eBook or Video being made available to you, i.e. during download then you should contact Customer Relations Team within 14 days of purchase on customercare@packt.com who will be able to resolve this issue for you.
  3. You will have a choice of replacement or refund of the problem items.(damaged, defective or incorrect)
  4. Once Customer Care Team confirms that you will be refunded, you should receive the refund within 10 to 12 working days.
  5. If you are only requesting a refund of one book from a multiple order, then we will refund you the appropriate single item.
  6. Where the items were shipped under a free shipping offer, there will be no shipping costs to refund.

On the off chance your printed book arrives damaged, with book material defect, contact our Customer Relation Team on customercare@packt.com within 14 days of receipt of the book with appropriate evidence of damage and we will work with you to secure a replacement copy, if necessary. Please note that each printed book you order from us is individually made by Packt's professional book-printing partner which is on a print-on-demand basis.

What tax is charged? Chevron down icon Chevron up icon

Currently, no tax is charged on the purchase of any print book (subject to change based on the laws and regulations). A localized VAT fee is charged only to our European and UK customers on eBooks, Video and subscriptions that they buy. GST is charged to Indian customers for eBooks and video purchases.

What payment methods can I use? Chevron down icon Chevron up icon

You can pay with the following card types:

  1. Visa Debit
  2. Visa Credit
  3. MasterCard
  4. PayPal
What is the delivery time and cost of print books? Chevron down icon Chevron up icon

Shipping Details

USA:

'

Economy: Delivery to most addresses in the US within 10-15 business days

Premium: Trackable Delivery to most addresses in the US within 3-8 business days

UK:

Economy: Delivery to most addresses in the U.K. within 7-9 business days.
Shipments are not trackable

Premium: Trackable delivery to most addresses in the U.K. within 3-4 business days!
Add one extra business day for deliveries to Northern Ireland and Scottish Highlands and islands

EU:

Premium: Trackable delivery to most EU destinations within 4-9 business days.

Australia:

Economy: Can deliver to P. O. Boxes and private residences.
Trackable service with delivery to addresses in Australia only.
Delivery time ranges from 7-9 business days for VIC and 8-10 business days for Interstate metro
Delivery time is up to 15 business days for remote areas of WA, NT & QLD.

Premium: Delivery to addresses in Australia only
Trackable delivery to most P. O. Boxes and private residences in Australia within 4-5 days based on the distance to a destination following dispatch.

India:

Premium: Delivery to most Indian addresses within 5-6 business days

Rest of the World:

Premium: Countries in the American continent: Trackable delivery to most countries within 4-7 business days

Asia:

Premium: Delivery to most Asian addresses within 5-9 business days

Disclaimer:
All orders received before 5 PM U.K time would start printing from the next business day. So the estimated delivery times start from the next day as well. Orders received after 5 PM U.K time (in our internal systems) on a business day or anytime on the weekend will begin printing the second to next business day. For example, an order placed at 11 AM today will begin printing tomorrow, whereas an order placed at 9 PM tonight will begin printing the day after tomorrow.


Unfortunately, due to several restrictions, we are unable to ship to the following countries:

  1. Afghanistan
  2. American Samoa
  3. Belarus
  4. Brunei Darussalam
  5. Central African Republic
  6. The Democratic Republic of Congo
  7. Eritrea
  8. Guinea-bissau
  9. Iran
  10. Lebanon
  11. Libiya Arab Jamahriya
  12. Somalia
  13. Sudan
  14. Russian Federation
  15. Syrian Arab Republic
  16. Ukraine
  17. Venezuela