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

Set default Opportunity sales stage name default

Hi All,

I want to prepopulate the stage name in Opportunity sales stage with "Prospecting" at the time of new opportunity creation. Can you please suggest me where I can configure the default value sales stage?
User-added image
NagendraNagendra (Salesforce Developers) 
Hi Vinay,

sorry for this issue you are facing.

May I suggest you please give a try by using below piece of trigger code which might help.
trigger OpportunityTrigger on Opportunity (before insert) {
     for(Opportunity opp:{
           //You can setup stage name here
           opp.stagename = 'Initial Interest';
Also, refer to below link for more help with a similar discussion. Please let us know if this helps.

Kindly mark this as solved if the reply was helpful so that it gets removed from the unanswered queue which results in helping others who are facing a similar issue.

Hi Nagendra,

I wanted to prepopulate the Stage name at the time when a user clicks on a new Opportunity button. I am not sure whether the above suggestion will help here.

May I know if I need to do any configuration setting?


Hi ,

I created the opportunity by writing the trigger but it is not populating the stage default. Please suggest.
Hi @Vinay_gupta,

If you are in lightning, we have one solution which a is bit lengthy but effective. It works for me.

Step 1) Create lightning component:
<aura:component implements="force:lightningQuickAction,lightning:actionOverride" >
	<aura:handler name="init" value="{!this}" action="{!c.doInit}" /> 

Js Controller
	doInit: function(component, event, helper) {
      var createAcountContactEvent = $A.get("e.force:createRecord");
          "entityApiName": "Opportunity",
          "defaultFieldValues": {
              'StageName' : 'Prospecting'

Step 2) Override standard opportunity new button with this lightning component:
User-added image

Please let me know if you have any question.

Gulshan Raj 

Raj VakatiRaj Vakati
You no need to write the .. try like this ... 
  1. Create a Quick action to create a new record and populate the predefined values
2 . Remove the new standard button and replace it with the quick action which created ...  
Raj VakatiRaj Vakati
Refer this link

Hi All,
Thanks for the Resolution.

Is creating a Component and overriding the standard 'NEW' button is the only way?
Is this something Configurable since I am looking for the solution which can be configured at the application end?