function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
paulmagpaulmag 

Populate a parent field from a child

I have created a fact find document which is attached to the account. I would now like to be able to display 1 or 2 fields from the fact find on the account page. Can anyone suggest a way to do this?

 

Paul

werewolfwerewolf

Well now wait a minute.  Your post is somewhat ambiguous and so depending on what you really mean this could be easy or it could be hard.  Let's consider the possibilities in order of difficulty:


1.  You have a custom object called FactFind and a lookup relationship on Account which points to exactly one FactFind.

 

This is good.  All you need to do to show some FactFind fields on the Account is to add a few custom formula fields, and use the formula builder (the Insert Field... button) to look up to the FactFind object and get the info from its field(s) and show them in your formula field.  Super easy.

 

2.  You have a custom object called FactFind which has a lookup relationship or master-detail to Account, and so there's a related list of FactFinds on Account.

 

This is not so good.  This means you can have many FactFinds for one Account, so how would you know which FactFind's fields to show in the Account?  If there's some way you can discover which one to use, then you can do so in an Apex trigger on FactFind to populate the Account with the relevant fields when an applicable FactFind is added.

 

3.  You are literally attaching a binary document (a word or excel doc or something) in the Attachments section of the Account.

 

This is bad.  You can _maybe_ write a trigger on Attachment to parse something out of the binary document and put it into Account fields, but it's not going to be easy.

 

So there you have it.  For your sake I hope your model falls into category #1.