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
Jose María Nicolás ArfelisJose María Nicolás Arfelis 

How to autopopulate a child object in Edit Mode with value in field on parent object?

Hi all,

I have the requirement to get a field autopopulated according to the value of another field.
For example, I have the parent object Postgraduate Course. This has the related list Questions (Preguntas):

The Question object has a lookup to the Postgraduate Course.
To distinguish among postgraduate courses with the same name, we use one field: the Edition of the Postgraduate Course.

The Question edit mode looks like this:

User-added image

For example, if the Postgraduate Course is SEGURIDAD CLINICA and the Edition of that Postgraduate Course is 2017-2018, when you click on the button New on the related object Questions, the field Edtion on this object should be autopopulated with the value in the field Edition of the Postgraduate Course, being in Edit Mode, so our client can recognize for which Postgraduate Course he will add a question.

Is something like that possible in Salesforce?.
Maharajan CMaharajan C
Hi jose,

If you the want to populate the field value after the record save you can use Formula Field(text),Process Builder.

During the record means you need to use the custom new button by URL hacking function.

Let me know which function you want?

Thanks,
Raj

 
Jose María Nicolás ArfelisJose María Nicolás Arfelis
Thanks for your answer, Maharaja.
One of my lines say "Edit Mode", I mean with that, I don't want to populate the field after saving it, I would like to populate it while editing the record. How would the URL hacking look like?.
Sridhar NarayansaSridhar Narayansa
Unfortunately, for a lookup field we can't pre-default values. Check the idea that has been posted. Vote It.

https://success.salesforce.com/ideaview?id=087300000007PidAAE

 
Jose María Nicolás ArfelisJose María Nicolás Arfelis
It is possible to autopopulate a lookup field in the Edit Mode. Maybe Maharaja is right.
Maharajan CMaharajan C
Sorry Jose, i will come to with you a solution asap.

Thanks,
Raj
Jose María Nicolás ArfelisJose María Nicolás Arfelis
Maharaja, thank you. Looking forward to it. Til now I found lookups can be autopopulated in Edit Mode, but I think text fields too.
Maharajan CMaharajan C
Hi Jose,

Sorry for the delay. I had some works in the past couple of days.

The below Links help to you. To get something about the URL Hacking.

http://writeforce.blogspot.in/2012/12/prepopulating-fields-using-url-hacking.html

http://kell.screenstepslive.com/s/knowledgebase/m/16056/l/163679-how-to-create-a-button-that-auto-fills-in-field-on-a-new-record

The URL hack can get the values in the text field based on the lookup but you have to create the new child records from the parent object.
By using the Related list in the Parent Object.

Because here you create the new custom and assigned that buton in parent relatedlist for child to create the records.

If the above things are doesn't help to you or you want someother methods then let me know.

If it helps then choose this as a best answer.

Thanks,
Raj
(Sweet Potato Tec)