Skip to main content

Here is the pseduo code for the same

trigger OppFieldUpdate on Opportunity (before insert, before update) {

for(Opportunity Opp: trigger.new) { if(Opp.StageName == 'Qualification') {

Opp.OppStatus__c = 'Won'; } }

}

trigger OppFieldUpdate on  Opportunity (before insert, before update) {

for(Opportunity Opp: trigger.new)
{
 if(Opp.StageName == 'Qualification')
 {
 
  Opp.OppStatus__c = 'Won';
 }
}

}

However by using Salesforce work flow field update we can achieve the same.

Here is the pseduo code for the same

trigger OppFieldUpdate on Opportunity (before insert, before update) {

for(Opportunity Opp: trigger.new) { if(Opp.StageName == 'Qualification') {

Opp.OppStatus__c = 'Won'; } }

}

However by using Salesforce work flow field update we can achieve the same.

Here is the pseduo code for the same

trigger OppFieldUpdate on  Opportunity (before insert, before update) {

for(Opportunity Opp: trigger.new)
{
 if(Opp.StageName == 'Qualification')
 {
 
  Opp.OppStatus__c = 'Won';
 }
}

}

However by using Salesforce work flow field update we can achieve the same.

Source Link
Asha
  • 51
  • 2

Here is the pseduo code for the same

trigger OppFieldUpdate on Opportunity (before insert, before update) {

for(Opportunity Opp: trigger.new) { if(Opp.StageName == 'Qualification') {

Opp.OppStatus__c = 'Won'; } }

}

However by using Salesforce work flow field update we can achieve the same.