
I am new to salesforce and learning triggers currently. Can you please help me in the below requirement.
Consider I have two fields ( Field A and Field B) on Object-X. On any record under Object-X, whenver I enter a value on Field A and click on update,this value should get updated on Field B as well. (I believe it is using Trigger.New). Kindly provide the code (Trigger and class) if possible.
Thanks in Advance.
Car
답변 5개
trigger fieldupdate on Account (before insert,before update) {
for(account a:trigger.new){
if(a.field2__c != ' '){
a.field1__c = a.field2__c;
}
}
}
you can also do this by creating workflow or process builder .
if this helps please select this as best answer