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

How to pre-populating fields?

When a user clicks "new" to make a new opportunity, they are faced with an entry form to enter in information. Is it possible to pre-populate one of these fields on this entry form using a trigger? 


There are three ways of doing it.


1. Use record type default values if these fields are picklist fields.

2. You can definitely do it within Trigger but it will not show on screen until you save record.

3. Override New Button and use a visualforce / Apex to prepopulate fields in Opportunity Form.




you can pass values throuth URL as well.



Pankaj Raijade

CRM AdminCRM Admin


Need assistance with your post


We could not get to populate the Opportinity name field. The URL shows we do not see the opp3 value being passed.


Please help.


Could you let me know the exact problem you are facing...

CRM AdminCRM Admin


Thanks for responding.

When we create a new opportunity we want the opportunity name to be defaulted to some value (just in the UI). I am trying to use your example to pass that in the query string. But in the URL i do not get the value of opp3.

This is what we see in the URL


The code in the post should work... could you paste the code that you are using here so i can take a look at it.