Blog

PhoneTools (v2.4 onwards): Adding the component to a page layout

To allow users in the organization to check the status of a phone number on a record, you will need to add the PhoneTools lightning component to the lightning record app page.

  • Go to Setup | Object Manager.
  • Navigate to the object that you would like to add the PhoneTools component to.
  • Select Lightning Record Pages.
  • If you already have a record page, select its label and press Edit. Or choose New if you would like to configure a new record page.
  • Select PhoneTools from the Lightning Components list on the left of the screen and drag the component to your desired location on your page layout.
  • In the panel on the right of the screen you will see four ‘(obsolete)‘ checkboxes, these can all be left unchecked.
  • Press Save, and Activate if required.

Note: you can use Add Filter to create rules for when the component is visible. i.e hide if phone field is empty.


Back to the PhoneTools (v2.4 onwards) installation walkthrough

 

PhoneTools (v2.4 onwards): Define a formula

What is a formula and how is it useful with PhoneTools?

A Salesforce Formula Field is a read-only field that derives its value from a formula expression you define. These are added to objects and their value is calculated per record. Each record can have a different output dependant on the formula expression that was written.

So how is this useful for PhoneTools?…

In some organisations, not every record needs screening so a quick way to identify whether a record needs screening is by defining a formula that calculates this for you.

What should my formula contain?

If in doubt, your formula should always edge on the side of caution as it is more important to screen records that you are unsure of versus rule them out from screening. It is important to review the criteria with your compliance team to identify what indicates whether a record can be excluded from screening. This will be organization-specific and as a result, can work out better to screen all records and ensure you’re TPS and CTPS compliant.

Creating a formula

In this example, we’ll assume that all records that need screening exclusively sit on records that contain “United Kingdom” in the country field.

  • Go to Salesforce Setup | Object Manager.
  • Select the object where you need to define a formula.
  • Select Fields & Relationships.
  • Select New.
  • Choose Formula.
  • Provide a Field Label and Field Name.
  • Select Number.
  • Set Decimal Places to 0.
  • Select Next.

If the formula results in “1”, the record will be screened.

If the formula results in “0”, the record will not require screening.

Using the above logic, we can now define a formula to meet our criteria. By creating an IF statement, we can query the record on meeting certain criteria. See the example below that checks if the record’s Billing Country field contains “United Kingdom” or is NULL.

IF(OR(BillingCountry='United Kingdom',ISBLANK(BillingCountry)), 1, 0)

When your formula is complete, select Save.

With a formula now created on the object, we need to apply it to the Fields to Screen section. Continue to the next article to complete this action.


Back to the PhoneTools (v2.4 onwards) installation walkthrough

PhoneTools (v2.4 onwards): One-time batch screen

  • Go to App Launcher | PhoneTools Administration.
  • Navigate to the Screening tab.
  • Select Screen Now.

PhoneTools will now execute a batch job to screen all configured records that have not yet been screened or are overdue. This is calculated from the Next Screen Due date field on the records.


Back to the PhoneTools (v2.4 onwards) installation walkthrough

PhoneTools (v2.4 onwards): Schedule a daily batch screening job

  • Go to App Launcher | PhoneTools Administration.
  • Navigate to the Screening tab
  • Within the Scheduled Screening section, select Enable Scheduled Screening to create a Scheduled Job that will execute each day, screening Not Screened and Overdue numbers.
  • To manage or delete the scheduled jobs, select Click here to view or delete scheduled jobs using the Salesforce Scheduled Jobs viewer.

PhoneTools will now have a daily job to execute a batch job to screen all configured records that have not yet been screened or are overdue. This is calculated from the Next Screen Due date field on the records.


Back to the PhoneTools (v2.4 onwards) installation walkthrough

PhoneTools (v2.4 onwards): Queue a Screen Immediately with a Salesforce Flow

Automated phone screening functionality covered so far in this installation walkthrough will screen records nightly that have not yet been screened or have their Next Screen Due Date in the past. Whilst practical, this leaves a space of time between the record being inserted/updated where the numbers won’t be screened until the next nightly batch job or user interaction.

That’s where flows come in to fill the gap.

Create a flow to screen the record

  • Go to Salesforce Setup | Flow.
  • Select New Flow.
  • Choose Record-Triggered Flow.
  • Search and select the object that you are configuring the process for.
  • Set Trigger the Flow When to A record is created or updated.
  • Select Done.

The flow will now be ready to start adding elements to.

  • Select the Decision Logic and drag it under the Start element.
  • Label: Is NULL or Overdue
  • API Name: IsNULLorOverdue

Under New Outcome:

  • Label: True
  • Outcome API Name: True
  • Condition Requirements to Execute Outcome: Any Condition Is Met (OR)
  • Resource: {!$Record.pw_pss__NextPhoneScreenDue__c} Note: this field will be the Next Screen Due Date field which may be custom dependant on your configuration.
  • Operator: Is Null
  • Value: {!$GlobalConstant.True}
  • Select Add Condition
  • Resource: {!$Record.pw_pss__NextPhoneScreenDue__c}
  • Operator: Less Than or Equal
  • Value: {!$Flow.CurrentDate}
  • Select Done

The decision element will now be shown in the flow and needs connecting to the start element.

Select and hold the connecter point on the Start block and drag it to the Decision element. This will create a connection between the two elements.

Now we need to add the Phone Screening element to the flow.

  • Select the Action Interaction and drag it under the Decision element.
  • In Action, search for Phone Screening and select the suggested item.
  • Label: Screen Phone Numbers
  • API Name: ScreenPhoneNumbers
  • ID of Record to Screen: {!$Record.Id}
  • Select Done.

The Screen Phone Numbers element will now be shown in the flow and needs connecting to the Decision element where the outcome is True.

  • Select and hold the connecter point on the Decision block and drag it to the Screen Phone Numbers element.
  • A modal will appear with an Outcome option. Choose True.
  • Select Done.

The flow is now configured and ready to Save and Activate. Repeat this process for each object that needs the functionality enabling for.

Summary of the functionality

When inserting or updating a configured record in Salesforce, this flow will now queue a task to screen the record immediately. This functionality relies on Salesforce Future Methods. Due to this dependency the results may not always appear visible immediately after record insert or update and the page may need to be refreshed before the statuses update. It is still advised to rely on the automated batch job to pick up all overdue records on its nightly run.


Back to the PhoneTools (v2.4 onwards) installation walkthrough

PhoneTools (v2.4 onwards) TPS & CTPS: Installation Walkthrough

PhoneTools is one of the quickest ways to begin screening your Salesforce records against the UK-TPS and UK-CTPS databases to check whether the numbers are safe to call. This installation walkthrough will get you set up with a basic configuration in no time so you can rest easy and know you have a solution in place.

For versions prior to 2.4, review documentation here.

Introduction

Object and field configuration

Record screening criteria

Lightning component

Screening options

PhoneTools (v2.4 onwards): Creating custom functional fields

What do the custom functional fields do?

PhoneTools relies on three custom fields to store a records’ TPS and CTPS status, we call these the “functional fields”.

The three functional fields are:

  • Phone Status Field
  • Next Screen Due Field
  • Screening Results Field

We will use these fields later in the configuration.

If you are implementing PhoneTools on one of the out of the box object, the functional fields have already been created for these object and you can move onto the next article.

If you plan to use PhoneTools on another object, continue reading.

Creating the functional fields for an object

When you know which object you need to create the three fields for, follow the steps below.

We’ll start by creating the Phone Screen Status field:

  • Go to Object Manager, locate the Object, and go to Fields & Relationships.
  • Select New.
  • Choose the data type: Picklist.
  • Select Next.
  • Add a Field Label (we suggest ‘Phone Screen Status’)
  • Select Enter values, with each value separated by a new line.
  • Add the following values to the text area:
    • Not screened
    • Error
    • Safe to Call (not listed)
    • Caution (partially listed)
    • Do Not call (listed)
  • Select Next.
  • Provide visibility to all the users who will be screening records, this can also be handled in a permission set afterward if preferred.
  • Select Next and Save.

Now for the Next Screen Due field:

  • Select New.
  • Choose the data type: Date/Time.
  • Select Next.
  • Add a Field Label (we suggest ‘Next Screen Due’)
  • Select Next.
  • Provide visibility to all the users who will be screening record, this can also be handled in a permission set afterward if preferred.
  • Select Next and Save.

And finally for the Phone Screening Results field:

  • Select New.
  • Choose the data type: Text Area (Long).
  • Select Next.
  • Add a Field Label (we suggest ‘Phone Screening Results).
  • Leave the Length and #Visible Lines at their default values.
  • Select Next.
  • Provide visibility to all the users who will be screening record, this can also be handled in a permission set afterward if preferred.
  • Select Next and Save.

Now your fields are created, you’re ready to start configuring the “Fields to Screen”!


Back to the PhoneTools (v2.4 onwards) installation walkthrough

PhoneTools (v2.4 onwards): Interactive record screening

Prerequisits

If you’ve completed Adding the PhoneTools (v2.4 onwards) lightning component to a record app page then it’s good news! You have instant access to interactive record screening. As a system administrator, you can sample this functionality immediately by navigating to a record where the component is configured and click the Screen Phone Numbers button.

…But the interactive record screening feature is rarely just for use by a system administrator so permissions need to be granted to your users.

Granting permissions to use interactive record screening

Users wanting to use interactive screening must have the editable permissions to each of the phone status fields required by PhoneTools.

  • Phone Status Field
  • Next Screen Due Field
  • Screening Results Field

The users must also have at least read access to all the configured phone fields on the object. For example:

  • Phone
  • Mobile

These permissions can be granted on the profile itself or via a permission set.


Back to the PhoneTools (v2.4 onwards) installation walkthrough

PhoneTools (v2.4 onwards): Choose which services to screen against

The fields are now configured with PhoneTools for screening and it’s now time to choose which service(s) to enable screening functionality against.

  • Go to App Launcher | PhoneTools Administration.
  • Navigate to the Screening tab.
  • Select UK-TPCS and/or UK-CTPS.
  • Enter an admin’s email address into Email address for screening alerts.
  • Select Save All.

Back to the PhoneTools (v2.4 onwards) installation walkthrough

PhoneTools (v2.4 onwards): Trigger creation

What’s supplied out the box?

PhoneTools comes packaged with triggers for the following objects:

  • Account
  • Contact
  • Lead

This means that if you’re only screening fields on the above objects, there is no requirement to add a custom trigger to your organization and you’re ready to move on to the next step.

If you plan to use PhoneTools on another object, continue reading.

Creating a trigger

We’ve made it as straightforward as possible to add a custom trigger to any object in Salesforce allowing you to start screening any phone field against the TPS and CTPS databases.

  • Go to Setup.
  • Navigate to Object Manager.
  • Locate the Object you want to create the trigger for.
  • Select Triggers and New.
  • Paste the following code snippet into the box provided.
Trigger PhoneToolsPhoneNumberUpdate_OBJECTLABEL on OBJECTAPI (before update) {
    pw_pss.PhoneNumberUpdateHelper.ProcessUpdate('OBJECTAPI', Trigger.oldMap, Trigger.newMap);
}
  • Replace OBJECTLABEL with the label name of the object you’re creating the trigger for.
  • Replace OBJECTAPI with the API name of the object you’re creating the trigger for.
  • Select Save.

Note: to deploy a custom trigger to production, you may be required to provide code coverage to the trigger. To do this, you will need to create an apex test to insert a record to the object you created a trigger on.


Back to the PhoneTools (v2.4 onwards) installation walkthrough