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

I need help understanding how to auto populate fields

I have a lookup field on the account that pulls from a list of accounts that have a specific value in a custom field.

I want to be able to take that value and populate a filed on the opportunity, and also use that account info to populate the address of that account on the opportunity as well.


The goal is to be able to use the related account and address information in the quote pdf template. If there is another way to do that I am eager to find out.


I don;t want my users to have to enter the same information multiple times.


Have you tried creating a quote template yet? Account and Opportunity fields should be available there, so you may not need to create a formula field unless you also want to display the Account information on the Opportunity.


Here is more information: Cross-Object Formulas


If you do want to go the formula route, you want to create a new formula field of type text on Opportunity, and use the formula editor to create something like:


1) For your account custom field:




where FieldName is the name of your custom field. 


2) For the address: this is a concatenated field in salesforce to begin with, so to display it on Opportunity, you would need to reference each part of the address in your formula. Something like:


Account.BillingCity+" "+BR()+
Account.BillingStreet+" "+BR()+
Account.BillingState+", "+Account.BillingPostalCode


I have a similar situation where I am trying to pull fields from the opportunity onto a custom object. I have the custom object linked to the opp through the master detail relationship and then several other fields (Account Name, and 2 custom fields) populated with cross-object formulas.


However, I'd like for the Account name to not just be a text field... is there any way to have this be related back without it being a lookup field that the sales person must manually lookup?