+ Start a Discussion
Mr. WMr. W 

Activity Record on Custom Object Not Displaying on Account Related List

I got a strange one... 

 

Until Yesterday, record of an activitiy on a custom object would also be displayed in the Activity History related list on the Account page. 

 

Example:  Custom Object: Visits. 

Log a task or activity on the Visit, which is related to an Account, and that activity would appear in the related list of the Account. 

 

However it has stopped working. 

 

Now when you add a task or activity and mark it completed on the custom object it displays on the custom object but never makes it up to the Account that custom object is associated with. 

 

Please Help!!!

 

 

Best Answer chosen by Admin (Salesforce Developers) 
Madhan Raja MMadhan Raja M

Goto Create > Object > Visit > Custom Fields & Relationships > Edit  'Account' field  > Click on 'Change Field Type' button at the top > Select 'Master-Detail Relationship' and click Next and Save.

 

If a reply to a post answers your question or resolves your problem, please mark it as the solution to the post so that others may benefit.

 

Madhan Raja M

All Answers

Madhan Raja MMadhan Raja M

 

Hi,

 

Until yesterday the relationship between Account and Visit are Master-Detail relationship. Now, it has changed to Lookup relationship and because of this change the completed activities are not able to display in the Account's Activity History related information.

 

Change the relationship from Lookup to Master-Detail and the completed activities of Visits will be display in the Account's Activity History related information.

 

If a reply to a post answers your question or resolves your problem, please mark it as the solution to the post so that others may benefit.

 

Madhan Raja M

Mr. WMr. W

Wow, that is a great idea.  I looked into the custom object and there is no master object specified.  How do I go about making the Accounts the master record? 

 

Is there a way to edit a custom object that is already deployed and make Acconts the master object?  Will it change any of the records that already exist?

 

 

Madhan Raja MMadhan Raja M

Goto Create > Object > Visit > Custom Fields & Relationships > Edit  'Account' field  > Click on 'Change Field Type' button at the top > Select 'Master-Detail Relationship' and click Next and Save.

 

If a reply to a post answers your question or resolves your problem, please mark it as the solution to the post so that others may benefit.

 

Madhan Raja M

This was selected as the best answer
Mr. WMr. W

This looks great!  Thank you.  I'll accecpt the solution, but one last question.  Do you know why activities on visits appeared on accounts until just recently?

 

 

Madhan Raja MMadhan Raja M

Because now Account and Visit are in Master-Detail relationship. If the objects are Master-Detail relationship, then by default all the activities in Visit (Detail) will be populated in Account's (Mater) related information.

 

Madhan Raja M

Mr. WMr. W

Thanks, that's great!

Madhan Raja MMadhan Raja M

You need to "Mark as Solution" to my post ;)

 

Madhan Raja M

Mr. WMr. W

I marked the last message I sent as solution accecpted. Can I edit it?

Madhan Raja MMadhan Raja M

Goto Options > Click on Not the Solution > Then mark the right post as "Accept as Solution".

 

 

Madhan Raja M

 

 

Mr. WMr. W

Sorry.  I implemented the change in sandbox and it worked fine.  However, when I went to do it in production i am met with this error.  

 

Cannot Create Master-Detail Relationship
You cannot create a new Master-Detail relationship on an existing custom object if records already exist. You must first create a Lookup relationship, populate the lookup field with data in all records, and then change the relationship type to Master-Detail. 

 

 

 

This is strange.  How would you recommend populating the lookup field?  Data Loader or Field Up-date?

Madhan Raja MMadhan Raja M

How many records are available in Visit object? If you have more records then go with Dataloader.

 

Madhan Raja M

Mr. WMr. W

There are hundreds of records.  Will this create a whole new related list that I then should use instead of the one that is already in place?

 

Madhan Raja MMadhan Raja M

Do you have a lookup in Visit object that points to Account object? If yes, then extract all the Visit records using Dataloader. Add the Account ID (Parent ID) in the .CSV file column and update it back to SF using Dataloader.

 

Madhan Raja M

Mr. WMr. W

Is it really the case that only a "Master Detail" relationship will populate items in a related list?  It seems silly that a custom object could have a "look up" relationship to associate it with an account and it does not populate in the account's related list becuase it is a look up instead of Master Detail.  

Madhan Raja MMadhan Raja M

Yes, only the "Master Detail" relationship will populate items in a related list because the Custom object will be the child for Account and if the Account record is deleted them the associated Custom object records are deleted. Just a lookup cannot do this task.

 

Madhan Raja M

Raja Bipin Chandra  M BRaja Bipin Chandra M B
Hello Madhan,

I am going thru similar issue where i have 2 Master-Detail relation fields (Account and Opportunity).However, the activity is being copied only to the single parent Account. Can you please let me know is this because Account is parent of Opportunity and can we not have same activity of a custom object copied both to Account and Opportunity?

Regards,
Raja