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
fredkafredka 

Pulling in fields for child object?

Hi - I am pretty new to salesforce - so new that we are still manipulating our trial account to see if salesforce will work for us.
 
We have two custom objects that are related.  "Oppty Product" is the parent and "Horizon Products" is the child.
 
I have a lookup for "Horizon Products" on the "Oppty Product" l layout.  What I would like to do it pull in a bunch of the fields from "Horizon Products" object onto the "oppty product" object.  These fields would need to have the ability to be changed by the user and would stay on the "Oppty Product" object.
 
Basically, we have a bunch of products but many of the products can be customized.  Thats why I want to pull in the default values from the Horizon Product but yet give the user the ability to modify them.
 
Is this currently possible?  If so, I would really appreciate some guidance - thanks!!!!!!
 
Fred
Best Answer chosen by Admin (Salesforce Developers) 
werewolfwerewolf
At the time he wrote that back in April, the TEXT function wasn't yet available for picklists, but now you can just say TEXT(Picklist_Field__c) and it will spit out the value of the picklist!  So that will simplify things at least.

All Answers

werewolfwerewolf
First of all, you say: "Oppty Product" is the parent and "Horizon Products" is the child.

But then you say: I have a lookup for "Horizon Products" on the "Oppty Product" layout.

These two statements are in direct opposition to each other, unless you meant to say that you have a lookup on Horizon Products to Oppty Products.

Regardless, you'll have a much easier time of it if Horizon Products is the parent and Oppty Product is the child, so more like your seconds statement where there's a lookup for "Horizon Products" on the "Oppty Product" layout.  In that case, you can create fields on Oppty Product which duplicate the corresponding fields on Horizon Product.  Then you can make a workflow rule which triggers when the Horizon Product is changed on the Oppty Product, and a corresponding field update which copies the contents of the relevant fields from the parent Horizon Product into the Oppty Product.

If Oppty Product were the parent and Horizon Product were the child, then there could conceivably be more than one Horizon Product per Oppty Product, and workflow wouldn't be able to copy fields in that direction.
fredkafredka
First I would like to thank you for answering my question.... I appreciate it!!!
 
I am a little confused (maybe because I am new to the salesforce structure) maybe I should not be using "parent object"
 
The user opens up a "Oppty Product" object and from a lookup they select one "Horizon Product".which then populates the name of the "Horizon Product" onto the "Oppty Product" object.
 
The Horizon Products object is pre-populated with data..... we are in the health insurance business so the horizon product holds things like "co-pay"  "deductible" etc.
 
When a user looks up the Horizon Product, I want these fields (copay, decuctible,etc) to populate into the "oppty product" object like the name populates over.
 
Hope that makes more sense and sorry about the confusion.  Thanks!!!
 
Fred
werewolfwerewolf
So yes, in your case Horizon Product is the parent and Oppty Product is the child, and you can make Workflow Field Updates to copy the fields from Horizon Product to Oppty Product.  That will be your best bet.
fredkafredka

Perfect.  Thanks again for taking the time to help me - I appreciate it !!!

Fred

fredkafredka

 Just two more questions, if I can....

The value I am trying to pull in is a picklist... it will not let me use a picklist - wants me to use the ispickval function but not sure how to use that because I don't have two arguments for the function - I just want the value

Also, this does not update until after the record is changed.  Is there any way to do this right after the lookup value is selected?

Thanks!!!

cafe2cafe2
I'm trying to write a similar formula. Did you ever figure this out?
fredkafredka

Hi- What I ended up doing is creating a visualforce page that lists the products from my "horizon products" object.  When a user selects one of the products, it opens up a "quote products" record and populates the fields from the "horizon products" object.

 

Hope that helps.

 

However, if you need help with the formula, I can probably help you... just tell me exactly what you want to do... thanks!!

 

 

werewolfwerewolf
At the time he wrote that back in April, the TEXT function wasn't yet available for picklists, but now you can just say TEXT(Picklist_Field__c) and it will spit out the value of the picklist!  So that will simplify things at least.
This was selected as the best answer
cafe2cafe2
Awesome! Thanks Fred & Werewolf!