+ Start a Discussion
AdamSBealAdamSBeal 

Displaying Account custom field in a Contact page layout

We have a Long Text Area custom field on Account called "Account Notes" would like to display that on page layout of Contacts related to that Account but can't figure out how to do so. I attempted to use a forumla field to display it but Long Text Area fields aren't allowed there so I am stuck. Any ideas on how to do this would be much appreciated. 

 

Thank you!

Best Answer chosen by Admin (Salesforce Developers) 
hemantgarghemantgarg

I think it can be achieved using a simple inline vf page on contact page layout. On inline page you can fetch the long text area field from the parent account and display it.

All Answers

Shivanath DevnarayananShivanath Devnarayanan

This is the 1st thought that comes to my mind :

 

A workflow rule and a field Update

 

  • You can create a Workflow rule on the contact object 
  • Set the Evaluation Criteria : Every time a record is created or edited, Or which ever Suits you
  • Add a simple rule Criteria
  • Add Workflow Action -- > New Field Update
  • Select the Field to update: (where I assume you already created a Text Area Field)
  • And in the Formula --> you could specify a simple master child traversal e.g.  "Account.Description "

Save it and Don't forget to activate the Workflow Rule.

 

There is an Alternate way, Which is to use Apex Triggers, And on every update or insert of an contact you could update it with any data from any related object. Which provides you with the flexibility to adjust if your requirement is complex to be placed in workflow. And it is always advised to use workflows if you can especially since its easier to maintain.

 

Hope this helps, Mark this answer solved if it helped you solve your problem , so that others may be benefited

 

More About Workflows 

AdamSBealAdamSBeal

Thanks but not sure I understand that solution. The account object is the one with the Long Text Area notes field I just want to display that on the page layout for any contacts related to that account.

 

Are you saying to create a duplicate Long Text Area field on the contacts object then when someone updates the notes field on the account object have a workflow fire that copies it to all child contact duplicate fields maybe?

 

I would think this is a problem others have come up against in Salesforce.

hemantgarghemantgarg

I think it can be achieved using a simple inline vf page on contact page layout. On inline page you can fetch the long text area field from the parent account and display it.

This was selected as the best answer
AnupamAnupam

This can be done as per HemantGarg suggestion too.

 

Other way is to write a trigger on account (after insert, after update, after delete, after undelete) and fetch the Account Notes from the account and populate and update it to the contact record.

 

Please mark it as solution if it fullfills your need.

Shivanath DevnarayananShivanath Devnarayanan

I agree to what Hemant Garg says,  if you just want the field details visually you'd be able to see it using a inline Visual Force page as part of the record. and if this suits your requirement I suggest this is the most easy way to achieve this.

 

Thanks Hemant Garg !

 

AdamSBealAdamSBeal

Thanks for all the replies I ended up doing it as Hemant suggested with an inline VF page works great!