Find your content:

Search form

You are here

How can I relate Activity to a second object?


Activity has a 'related to' field that links it to an object of various types. I need to link each activity to a Campaign, but also to an Opportunity. However Activity custom fields don't let me add a lookup relationship.

The reason I need this is that if I talk to John Doe (Contact) about his WidgetBoxes subscription (Opportunity) I need to record that the call was part of the August2012 Campaign.

This lets me find all Activity logged against this particular Campaign. It also lets me find all Activity logged against WidgetBoxes and it also lets me find every time we called John Doe.

Is there something I'm missing that would let me add this extra relationship?

Is this a Black Tab setting that Salesforce could turn on for me internally?

Attribution to: RickMeasham

Possible Suggestion/Solution #1

Salesforce is releasing this functionality as a pilot in the upcoming Summer '14 release. This has been one of the high rated ideas and should be available soon.

Attribution to: Yashvinder Singh

Possible Suggestion/Solution #2

There is no straight forward or OOB functionality to achieve this, although you can look at custom VF and controller to get desired result.

Attribution to: Abhishek

Possible Suggestion/Solution #3

You can link your Opportunity to a Campaign using the "Primary Campaign Source" standard field.

If you then link the Activities to the Opportunity you should be able to find them again later by filtering by Opportunities that are linked to a specific Campaign.

Can you give any more info on how your planning to find these Activities? (I.e. Via a report or Apex)

Attribution to: Jon Hazan

Possible Suggestion/Solution #4

SFDC does not allow this currently. You cannot add lookup fields or junction objects to Tasks to enable what you want to do.

Workaround today include creating your own Task object and recreating Task functionality. This is how Milestones PM Application on AppExchange works (Source is available on GitHub).


You can relate a Task to multiple Objects in the System. Gives you flexibility to cusotmize however you want within confines of Formula Fields, Roll Up Summaries, etc.


You lose ALL the special features of Activities like:

Outlook Integration Popups (Nag Boxes) for Task Reminders Activities History Rollups on Account Activity Archiving etc.

One final note:

As of Summer 12 release they added the ability to relate an Activity (Of Type TASK) to multiple Contacts. You need to enable that in Setup Menu under Customize->Activities->Tasks.

The API object for the junction is "TaskRelation". This was a HUGE step up as before you could only relate one object and one contact to an Activity. Now you can do one object and up to 10 Contacts. If you inspect the TaskRelation object you will note that it stores both information for Contacts as well as Objects. #SAFEHARBOR It's possible in the future SFDC may use that object to relate to multiple Objects, the architecture supports it. Just a matter of performance I'm sure which is a huge consideration for SFDC.

It may be in your best interest to wait it out and see if they enable this in a future release.

UPDATE WINTER 15 SFDC is opening up this functionality as a BETA - "Add Custom Lookup Fields on Activities (Beta)". Page 107 of Release notes:

Attribution to: CoryCowgill
This content is remixed from stackoverflow or stackexchange. Please visit

My Block Status

My Block Content