How can I auto populate related Vendors list of a parent while creating a new child to it ? is there any out of the box feature in salesforce or does it need trigger and apex programing?
2 Answers
No, there is nothing out of the box. You COULD use a trigger to copy the relationship down, but I would probably instead do a custom Visualforce page to embed in your page layout. Use the lookup on the child object to query for all the objects related to the parent.
This would keep your objects simple/less cluttered while still displaying the information.
-
I am totally new to salesforce and visual force ... i am trying to write a trigger but not getting how to accomplish the program... any guidiance on it?– NamitaCommented Jun 15, 2015 at 18:16
You could use a Flow with a Loop. Do a Fast Lookup of the Parent's Vendors, then through a Loop change the variable for the Id of the Parent to the Id of the child. From that Loop you then do a Record Create and create those records to the Child.
-
how can i follow these steps... is there any link or blog which could help ?– NamitaCommented Jun 15, 2015 at 18:16
-
I have not written a blog on this exactly... but I do have a blog written on something similar. Check these two posts out: Learning Loops (goo.gl/E1MXtJ), and example of a Roll-Up Summary (goo.gl/UjwN9N), so instead of doing the 'update' to the records on this, you would go for a Record Create. I'll see if I can spin up an example real quick of what the finished Flow would look like and edit my answer. Commented Jun 16, 2015 at 0:45
-
Namita, I have created the solution in a dev org. Here is the info: USERNAME ([email protected]) PASSWORD: (St4ck3xchange), in here you will find one Flow and one Process Builder that does what you want. I based it off of the Opportunities instead of "vendor", but it should be what you are wanting. In the Loop I did a Record Create to copy the "vendor" records associated to the Parent Account. Took me a few trys, but I got it solved with just 4 elements in the Flow. The hardest part will be mapping fields in your Flow (you'll see it in the Record Create). Hope this helps! Commented Jun 16, 2015 at 1:17
-
Thanks so much for taking out time for this. But I am unable to login with the uder id, it asks for email verification code .Pls help !– NamitaCommented Jun 18, 2015 at 15:25
-