In this post, we showed you how to add call duration to a Salesforce Activity page. However, you might have been reading through it and thought - hey wait, Salesforce is only showing me call duration in seconds! That might work just fine for you and your organization, but some of our users will want to display call duration in minutes. Here's how to do it.
As the Salesforce Administrator in Lightning, navigate to Setup and then select the Object Manager tab. Click on Activity.
Select Field and Relationships, and then click on New.
Select Formula as your data type and click Next.
Enter in the name you would like. I used "Call Duration (Min)" here. Then choose Text as the Formula Return Type and click Next.
Switch to the Advanced Formula tab and then copy and paste the following text into the highlighted space shown below. After you've pasted it, click Next.
IF((MOD(CallDurationInSeconds/60,1)*60) > 10, TEXT(FLOOR(CallDurationInSeconds/60)) + ":" + TEXT(FLOOR(MOD(CallDurationInSeconds/60,1)*60) ), TEXT(FLOOR(CallDurationInSeconds/60)) + ":0" + TEXT(FLOOR(MOD(CallDurationInSeconds/60,1)*60) ))
Select the profiles you want to be able to see and/or edit this field and click Next.
Check the box next to Task and any other layouts you want the field to appear on. Finally, click Save.
Navigate to a task and you should now see Call Duration (Min) displayed on that task page.
You can now see that there are 2 Call Duration Fields - one displays duration in seconds and one outlined in red that displays call duration in minutes (this is the custom field we just created).