+ Start a Discussion

Prepopulating Field Values on Related list

Hi, I wanted to know how I can prepopulate the Lookup values.
There are two custom objects (school__c and student__c) having master detail relationship to Opportunities. 
This is my button code:
<button class="slds-button slds-button_neutral">
When I click on add, by default I am getting only School__c as prepopulated,
I want student__c also to be pre populated. 
Raj VakatiRaj Vakati
{!URLFOR(target, id, [inputs], [no override])}

{!URLFOR( $Action.Child_Object_Name__c.New , null, [saveURL=Parent_Object_Name__c.Link, retURL=Parent_Object_Name__c.Link, CF00NE0000002aLV0_lkid=Parent_Object_Name__c.Id , CF00NE0000002aLV0=Parent_Object_Name__c.Name])}

Refert this link

Thanks for quick response, 
At this moment, I don't want to Return to parent record after click on save.(this is not my requirement)
All I wanted is Prepopulate the values while creating a Opportunity
Below are some of the facts I forgt to tell in beginning.
> This button is there on School__c object(in Related List)
>If I click on Add button, School__c.Name will be prepopulated, 
> I want Student__c.Name also to be prepopulated.

As you said I tried the code
<apex:outputLink value="{!URLFOR( $Action.Opportunity.New , null, [saveURL=Student__c.Link,
CFa023B000001l1XM=Student__c.Id , CFa023B000001o38E=Student__c.Name])}">

This is the error I am getting 
Invalid field Link for SObject Student__c