Skip to main content
2 of 2
added 32 characters in body
Santanu Boral
  • 36.2k
  • 8
  • 45
  • 72

Update Record in before trigger

I have one trigger on Opportunity which will copy the value of some Account field into opportunity field. All I'm doing in before trigger because I also have validation rule on opportunity which will fire on opportunity.

But in before trigger my values are not getting updated. here is my code:

for(Opportunity op : Trigger.New){

    op.Checkbox1 = op.Account.Wal_Checkbox1;
    op.Checkbox2 = op.Account.Wal_Checkbox2;
    op.Checkbox3 = op.Account.Wal_Checkbox3;
    op.Checkbox4 = op.Account.Wal_Checkbox4;

}
salesforce Developer
  • 3.4k
  • 12
  • 57
  • 104