Contact Roles on Custom Object - Answers - Salesforce Trailblazer Community
Trailblazer Community
Ask Search:
Christopher ClareChristopher Clare 

Contact Roles on Custom Object

I have created a custom object (and tab) called Projects into which we put all of the information relating to a project.  Amongst this I have lookup fields for User and Contact for internal people working on the project and client sponsors / stakeholders.  

I would like that when I send an email or log a call on the relevant contact record (and ideally the user one but less important) the email or call log automatically populate the relevant Activity History section on the Project tab.  

In essence, this is the same thing that happens when you have assigned a Contact Role to an Opportunity - you email the contact and a copy of it appears on the Opportunity page.

Unfortunately, it doesn't do this when you just have a lookup field to the Contact record.

Can anyone help!
Austin NordmanAustin Nordman
You are trying to do the reverse actually in this situation.  The contact is relating up to the opportunity, however contact is trying to relate down to its child object (projects).  This will not work because you can have many projects per contact, and it would have no way of knowing which one to update.  You can probably have it move up from project to contact, and have the activity history updated that way if you would like.  
Christopher ClareChristopher Clare
Thanks Austin - Can you give me a bit more granularity into how I would do this in practice. 
Austin NordmanAustin Nordman
Here is some more info on it:

Notes on Enabling Activities for Custom Objects

Available in: Contact ManagerGroupProfessionalEnterpriseUnlimited, and Developer Editions

  • If you enable activities when creating a custom object, the activity related lists are added to the default page layout automatically. If you enable activities later, after the custom object already exists, you must add the related lists to the page layout manually.
  • Disabling activities for a custom object does not delete existing activity records. However, activity related lists are removed from custom object pages, and reports containing activities and the custom object are deleted.
  • If a custom object has a master-detail relationship with accounts, the custom object’s activities roll up to the account and cause the account’s Last Activity date to be updated. For custom objects related to other types of records, the activities do not roll up.
  • The ability to send emails or create mail merge documents is available for activities on custom objects. The email must be sent to a contact or lead.
  • When you change the ownership of a custom object record, any open activities related to that custom object are also transferred to the new record owner.
  • You cannot disable activity tracking for a custom object if any workflow tasks are associated with that custom object, or if tasks and events are child data sets of the custom object in a mobile configuration.
  • Custom object records can only be associated with a call log in Salesforce CRM Call Center if activities are enabled for the object.

Christopher ClareChristopher Clare
Great, I can now see how my activities on the Project appear on the Account (Master-Detail relationship) but not the Opportunity (also Master-Detail relationship).

If I create a Master-Detail relationship with the Contact - I want it to do the same as it does with the Account - the notes below though say that it won't (because it's not a relationship with the Account!) 

What did you mean by 'Create a Trigger' to cause it to happen?

Really appreciate your help...

Chris
Austin NordmanAustin Nordman
A trigger would have to be done by a programmer, although I think this one would be on the easier side.  If you go to the developer boards, you may find a solution, or if you ask some of them may be nice enough to give you a result ;)  
http://boards.developerforce.com/sforce/?category.id=developers
Christopher ClareChristopher Clare
Thanks ever so much, all clear and understood.

One final question, can you use a trigger in Professional Edition - we don't have the developer version.

Most appreciated,

Chris
Austin NordmanAustin Nordman
Triggers are usable in any version to my knowledge
Christopher ClareChristopher Clare
Brilliant, thank you.