You need to sign in to do that
Don't have an account?
Yogesh Biyani
Update an account field using Account trigger
I am still learning about triggers and for some reason following is not working. Any idea what is wrong? I do not get an error message, just that the trigger does not update the custom field.
trigger populateRecName on Account (after insert,after update) { for(Account acc: trigger.new){ if(acc.RecordType.Name == 'Joint Account'){ acc.rec_type__c = 'Joint Account'; update acc; } } }
Let us know if this will help you
There was to manny issue in your code
1) You was doing the DML inside the for loop
2) You used After event.
Its always better to check recordTypeId. Let us know if this will help you