You need to sign in to do that
Don't have an account?
raj_sfdcc
Workbench is not throwing the error while updating account through before trigger?
i have below Trigger:
Class:
So when iam triying updating records through Workbench with account Name field as null also it is running fine.Ideally Account Name is RequiredField so we shoud get error while updating.iam confused weather it is due to order of execution or any other reason kindly help me out with this.
trigger AccountTrigger on Account (before update) { List<account> acclist=new List<account>(); for(account acc:trigger.new){ acclist.add(acc); } AccountTriggerHandler.updateaccount(acclist); }
Class:
public class AccountTriggerHandler { Public static void updateaccount(List<account> acclist){ List<account> updatelist=new List<account>(); for(Account acc:acclist){ acc.phone='90000324902'; updatelist.add(acc); }}
So when iam triying updating records through Workbench with account Name field as null also it is running fine.Ideally Account Name is RequiredField so we shoud get error while updating.iam confused weather it is due to order of execution or any other reason kindly help me out with this.
Ravi Dutt Sharma
The account records is the list which you are iterating already have the account name populated on them. In addition to the name, you are populating the phone number. Why you are expecting it to throw an error?
raj_sfdcc
In the CSV file iam giving the Name field as null and trying to update.that is why iam thinking of getting error.am i analysing wrong?