Pages

Sunday, January 3, 2021

Salesforce: Customize Log a Call button

 More than 2 years ago, I blog on Log a Call button does not appear in Activity, this blog would be the continue with the following scenario: 

  • Instead of call "Log a Call", we need to name it "Log an Activity"
  • Add a custom field in the "Log an Activity" panel called "Area"
  • Add "Area" field in the Activity logged panel

Add custom field
From Object Manager, you will not see the New field button in the Task object, but go to the Activity object, then you will see the New button in Fields & Relationship.
Create the custom field here, you may choose to add the field to Event and Task layouts.



Create "Log an Activity" action
From the Setup menu, go to Global Actions, then click the New Action button, select and enter the data then click the Save button.


You will see a layout to add/remove fields for the new action, let us add "Area" here, click the Save button once done.



Add "Log an Activity" action to Activity component
Let us add the "Log an Activity" action (and remove the "Log a Call" action if exist) from Contact. Go Contact object from Object Manager, open a page layout (make sure this is the correct page layout). Look for the "Salesforce Mobile and Lightning Experience Actions" section, if you see the message "Actions in this section are predefined by Salesforce", click the "override the predefined actions" link.

Click "Mobile & Lightning Actions" at the top panel then drag the "Log an Activity" action to the "Salesforce Mobile and Lightning Experience Actions" section, also remove the "Log a Call" action if exist. Click the Save button when done.



Now you should see the "Log an Activity" tab (with Area field) under Activity in Contact.


Once the activity saved, it will show as a closed task, but Area is not added yet.



Add "Area" field in the Activity logged panel
Navigate to Task object from object manager, click Compact Layouts tab, then New (or edit existing compact layout), add Area field, I also add a few more fields such as Status, Created By.



Click the "Compact Layout Assignment" button to assign the newly created layout as the primary compact layout.



The "Subject" will appear on the top (next to the icon) and the "Description" field will be shown by default. If you go to Account, you will see the same task too, because, by default, activities from Contact will roll-up to Account. However, there is a small difference here, instead of showing "you logged a call about" account name, here you will see the task with "you logged a call with" contact name.



Reference:

No comments:

Post a Comment

Page-level ad