You need to sign in to do that
Don't have an account?
pooja biswas
old account records
Hi
I am trying to understand trigger basics, so I have an custom field HelloWorld in acocunt object and when I create a new record I am updating the custom field with some value and the code is working
My requirement is to update the custom field in the old account records also.
How to access old record records?
Pls let me know.
Thanks
Pooja Biswas
I am trying to understand trigger basics, so I have an custom field HelloWorld in acocunt object and when I create a new record I am updating the custom field with some value and the code is working
My requirement is to update the custom field in the old account records also.
How to access old record records?
Pls let me know.
public class HelloWorld { public void Display(List<Account> acc) { for(Account val:acc) { if (val.Hello__c == null) val.Hello__c='World'; } } } trigger trgupd_hello on Account (before Insert,before update,before delete,after insert,after update,after delete,after undelete) { if (trigger.isBefore) { if (trigger.isInsert) { HelloWorld obj_hello=new HelloWorld(); obj_hello.Display(trigger.new); } } }
Thanks
Pooja Biswas
You want updated all stored account object data?
If Yes, Be aware It will cause the recursive trigger, Base on event you mentioned in trigger.(before Insert,before update,before delete,after insert,after update,after delete,after undelete)
~Thanks,
Onkar Kumar
All Answers
You want updated all stored account object data?
If Yes, Be aware It will cause the recursive trigger, Base on event you mentioned in trigger.(before Insert,before update,before delete,after insert,after update,after delete,after undelete)
~Thanks,
Onkar Kumar
I do not want to update all records.
only for those records whose Hello__c is not updated .
so I cannot achieve my requirement using trigger.
fine , then I can go with data loader.
Thanks
pooja