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
EileenSFDCnewbEileenSFDCnewb 

"Newbie" assistance request

Greetings all,
 
I'm fairly new to SFDC customizations, so I'm wondering if someone might be able to help me !
 
I have two custom objects..  let's call them TableParent and TableChild.
 
TableParent has the following fields:  Primary1, Field2 and Field3.
 
TableChild has a a field called MyParent, which is simply a lookup against TableParent (and produces a selection list of the parent table's primary field, Primary1).
 
TableChild also has fields ParentField2 and ParentField3.  I would like these to auto-populate based on the selection of MyParent.
 
How to proceed?
 
Thanks to any and all assistance,
Eileen M,
newb extrodinaire
RMMCRMMC
I have found that "Autopopulate" questions throw SFDC support people into a tizzy.  The most popular answer I get is, "We can put you in touch with a "partner" that will charge you are large fee to help you out."
TykeTyke
I do similar things. What i do is to create my child records via an S-control on the parent. The Control is called something like 'New Child'.
The important thing that you have to do is educate your users into creating children using the control and not through pressing the 'New' button on the child tab.
The code behind the S-control looks something like:

<script language='JavaScript'>

function redirect() {
 parent.frames.location.replace("/800/e?CF00N40000001U29x={!Parent_Field1}&CF00N40000001UAbc={!Parent_Field2}")
}

redirect();

</script>
The /800 is the id of your child edit page. You should be able to see this in the address bar at the top of your browser when you are inputing details of a new child.
The CF00N40000001U... are the names of the form fields you wish populating in the child edit page. If you use firefox then you can see these by using 'Tools' -> 'Page Info'
EileenSFDCnewbEileenSFDCnewb
Fantastic Tyke!
 
Thanks for this information.  After battling through many "Bad Link" errors, (and doing a lot of forum searching), I finally got my s-control to save.  How do I now tie this s-control to my Child Form so that when myParent is chosen, the other fields populate?
 
Thanks again for all your assistance,
Eileen
TykeTyke
Sorry to disappoint you but you can't work it backward from the Child to the Parent.
You can only use this when starting from the Parent record you want to create a new Child.
I only have professional edition here. If you have Enterprise then maybe you can have an S-Control on the Child that uses API calls to retrieve the information you would like from the Parent, but you'll need someone with Enterprise experience to help you there.
EileenSFDCnewbEileenSFDCnewb
Hmm...  this is a bit disheartening :(
 
I get the sense what I am trying to do will be a snap post Apex-beta (April?).
 
In the meantime however, I suppose I can disband my parent table, (since its purpose was to provide data validation against the child form), and instead create and validate input using Javascript (creates a bit of a maintainability issue), and then parse the values into the target object, (the 'child' form).
 
Anyone have an example they could share with me to get me started?  (Or if my approach is wrong, a bit of guidance?)
 
Thanks,
Eileen
TonkaCruiserTonkaCruiser

I have been playing with this reverse populate from a child object to a parent object and have come up with a dirty process that you might be able to use.  This process will hopefully become obsolete when the new version of SF becomes available with Apex.

 

First thing you will need is a field on the parent that will hold the child ID and a field on the child that will hold the parent ID.  You have to create the child object through the use of a sControl or custom link.  You will use this link to populate the new field “Parent ID” on the child.  You can then use this ID in a custom link to target the parent object and update the parent with the child information.

 

If you use this reverse link you can populate the parent with the child ID and then use those two ID fields to maintain data in both objects.  If you used an sControl you could probably have the child and parent update with the correct information at once but a custom link will require two links to be activated, one on the parent and then on the child.  At this time I’m only proficient with custom links so this is the process I have chosen.

 

This process will only work from the parent with the newest update from a child.  If you create a new child and update the parent’s Child ID field then it will only allow information passed on to the newest child.  Like I said, this is a dirty process and will require your users to perform extra steps and then there is always the chance that the data will not be maintained by them.

 

Please let me know if this does or doesn’t make sense, Chris

EricBEricB
If you don't really want to copy the data, but just want to see the data from the parent object, you should cast a vote for this feature on the IdeaExchange:

http://ideas.salesforce.com/article/show/22246


Cheers,
Eric