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
NevDevNevDev 

auto populate child record name

If I create a Quote from within an Opportunity then I would like the Quote Name field to reflect the Opportunity Name field. I know it can be done using workflow but it only updates the field after you save the record and also you need to have some text in the Quote Name field as it is a mandatory field.

How can I have this field pre populate with the Opportunity Name field when a user clicks on the "Create Quote" button?
VamsiVamsi
Hi newdev,

Please create a new custom button on Quote as shown and add this new button to the quote related list on opportunity page layout.

User-added image

Please mark as best answer if the above helps ..!!!
Ashish DevAshish Dev
You need to create custom button (list) and prepare url in the format 0Q0/e?retURL=%2F00628000008xrfY&oppid=00628000008xrfY&Name=test.
in the above partial url replace your oppty name in place of test.
Refer http://raydehler.com/cloud/clod/salesforce-url-hacking-to-prepopulate-fields-on-a-standard-page-layout.html for more detail.
NevDevNevDev
Hi Ashish,

I receive the following error:

URL No Longer Exists
You have attempted to reach a URL that no longer exists on salesforce.com. 

You may have reached this page after clicking on a direct link into the application. This direct link might be: 
• A bookmark to a particular page, such as a report or view 
• A link to a particular page in the Custom Links section of your Home Tab, or a Custom Link 
• A link to a particular page in your email templates 

If you reached this page through a bookmark, you are probably trying to access something that has moved. Please update your bookmark. 

If you reached this page through any of the other direct links listed above, please notify your administrator to update the link. 

If you reached this page through a link on our site, please report the broken link directly to our Support Team and we will fix it promptly. Please indicate the page you were on when you clicked the link as well as any other related information. We apologize for the inconvenience. 

Thank you again for your patience and assistance. And thanks for using salesforce.com!

Click here to return to the previous page.
 
NevDevNevDev
Hi Vamshi

I recieved this error when I tried your suggestion:

Unable to Access Page
The value of the "oppid" parameter contains a character that is not allowed or the value exceeds the maximum allowed length. Remove the character from the parameter value or reduce the value length and resubmit. If the error still persists, report it to our Customer Support team. Provide the URL of the page you were requesting as well as any other related information. 
 
VamsiVamsi
Ok try to build the URL on your own as follows 

1. Get the part of the URL starting from /0Q0/e? to end by clicking on new Quote from opportunity.
2. then modify the url by removing the opportunity id value from the above URL and replace it with {!Opportunity.id}&Name = {!Opportunity.Name}
3. Now create a new custom button on Quote with
Display type -  LIST Button 
Behaviour - Display in new window 
Button or link URL - Place the new URL you created in it and save.

Now add this button to Quote related list on opportunity page layout and give it a try..

 
NevDevNevDev
Hi Vamshi,

I no longer get the error but the Name field remains blank. See screen shot below.

User-added image
NevDevNevDev
Sorry Vamshi,

It's working now for some reason. 
NevDevNevDev
This works to a point. It is recreating the edit page within the salesforce edit page. If you click on the New Custom Button multiple times to create a new record it recreates multiple edit pages inside the previous edit page. Please see the screen shot below.

User-added image
VamsiVamsi
Did you select the display behaviour as below 

Behaviour - Display in new window