Modify(add or remove) fields on ‘New Task’ tab of activity component in lightning experience – Salesforce

Requirement: Add custom field on any tab of Activity component in Account Lightning record page. We will add Start Date in New Task tab of Account.

undefined

STEP 1: Create Custom field in activity.

So this is a thing with Salesforce. If you want to add new field on Task or Event, you will have to add custom fields in ‘Activity’ object. All three are different object but are same the same time. Yup, sometimes salesforce behaves like a girl!

  • Go to setup > Object Manager > ‘activity’
  • Create new field ‘Start Date’ on activity object.

STEP 2: Create New Action in Account object.

Idea is to update layout of ‘New Task’ tab. So we will create new ‘Action’ in account with new action layout. And we will replace the newly created button with old one.

  • Go to setup> Object manager > ‘account’
  • >Buttons, Links, and actions > ‘New Action’ (Enter following information)
    • Object Name: account(read only)
    • Action Type: ‘Create a new record’
    • Target Object: ‘Task’
    • Standard Label Type: –None–
    • Label: New Task x (adding x temporarily, we will ‘x’ remove it later)
    • Name: ‘New_Task’
    • Description: Creating new action and action layout for new task.
  • Save.
  • It will take you to edit layout screen. Add all the fields you want and other customization like mandatory field etc.
    • In our case, I will add ‘start date’ field as shown below, I have made start date and Due date as mandatory fields.
    • >Save.
  • This is called ‘Action Layout Editor’.

STEP 3: Update page layout of ‘Account’ and add button in ‘Mobile & lightning actions’

To add a tab in ‘Activity component’ in lightning experience, we have to add a new action in mobile and lightning experience actions of page layout. So, figure out on which account’s page layout you’d like to show the new layout.

Here we will replace old ‘New Task’ button with new button called ‘New Task x’.

  • Go to setup>Object Manager > account
  • > Page layouts > Click on Account Layout(figure out which one you have to edit).
  • > Mobile & Lightning Actions > add ‘New Task x’ and remove ‘New Task’ > Save.undefined

STEP 4: Done. (Update name of button to ‘New Task’, remove the ‘extra x’.

undefined
And that’s how it’s done…

Leave a comment

Design a site like this with WordPress.com
Get started