Phone and Email on Tasks or Events in Lightning Experience
A Brief Comparison With Classic and Lightning Record Pages
Despite the fact that the Lightning Experience provides a bigger experience in Salesforce, many individuals still favor Salesforce Classic. One of the key reasons is the change in how various features are handled, which is quite known due to the long-term use of Salesforce Classic.
People simply miss how easy it was to operate in Salesforce Classic and have been unable to adapt to the new Lightning Experience versions.
In this article, we’ll look at something that can be altered in Lightning Experience just like it can in Salesforce Classic, as well as how it behaves in Lightning Experience.
The Phone and Email fields do not appear on Tasks or Events records in Lightning Experience. Because the Task Details page does not display the Contact/phone Lead’s number or email address, those who want to use it to make callbacks will find it useless.
In Salesforce Classic, however, the same fields are available for Task and Event pages.
Fields on the record are limited to the accessible fields on the object in Lightning Experience. However, a significantly modified version of this approach is available on Lightning Experience. When hovering over the Contact/Lead lookup on a Task record, you should see the phone number and email data on the hover component. The Compact layout on the Lead/Contact object controls the fields that appear when you hover over them.
Simply, if the Contact or Lead is linked to Tasks or Events, however, the Phone and Email fields will appear in Lightning when you hover over the name of the Contact or Lead.
If you check the Page Layout of the Task, you can see that these two fields already exist there, and that is why we could be able to see it on the Classic Page.
How to have Phone and Email fields on Tasks and Events in Lightning?
Let’s see how to resolve this.
1 — Create a Custom Lookup field for Contacts or Leads on Activity.
- Go to the Object, Activity
- Create 2 Lookup Fields as follows
You have to create another Lookup field for Lead as well.
2 — Create two custom Formula fields to capture the Phone and Email from the Contact or Lead lookup field on the Task or Event.
Formula used
- Phone : IF( ISBLANK( Contact__r.Phone ), Lead__r.Phone , Contact__r.Phone )
- Email : IF( ISBLANK( Contact__r.Email ), Lead__r.Email , Contact__r.Email )
3 — Add a Process Builder to the Task to update the Contact or Lead Lookup.
- Navigate to Process Builder
(Gear icon > Setup > Process Automation > Process Builder > New) - The process starts when: A record changes > Save.
- Click Add Object. Select Object: Task or Event.
- Start the Process: When a record is created or edited, Advanced: Check Yes > Click Save.
- Click Add Criteria
- Enter a Criteria Name
- In Criteria for Executing Actions, select Conditions are met.
- In Set Conditions, set it to Name ID is NULL boolean false
- Click Add Action
- Action Type: Update Records
- Choose an Action Name
- Record Type: Select the Task record that started your process
- Criteria for Updating Records: No criteria — just update the records!
- For Field, choose either the Contact or Lead created above.
- For type, choose Field Reference
- Value: Task > Name ID > Choose
- Click Save and Activate the Process
Now check the Task Record page in Lightning.
Now, we are able to get the Phone and Email with values. You can see, the fields Contact and Lead are also visible. It is because we have added those fields in Task Layout while creating them. We can remove them there. Or else, we can ignore adding them while creating them.
I’ve removed the already existing Email and Phone from the Task Layout and I can see the newly created Phone and Email in both Lightning and Classic.
You may use the same way to display any other fields on tasks or events, such as the mailing address from the contact or lead object. This field update operation will NOT copy all of the Contacts’ phone numbers. The field update action will only copy the phone or email values from the first Contact record if you have several records.
Hope this article can help. Share your thoughts too.