You need to sign in to do that
Don't have an account?
MySet
Trigger concept
Hi,
Suppose I want to see all the fields of a particular record of an Account through Trigger.new or Trigger.old, how can we see that in debug log?
Trigger triggerName on Account(before insert, before update){
for(Account a : Trigger.new){
System.debug('I want to see all fields of a record'+ WHAT_NEED_TO_BE_ADDED)
}
System.debug('I want to see all fields of a record'+a.name);
System.debug('I want to see all fields of a record'+a.Id);
......
and so on.
but you need to write all fields.
Instead better to use below.
System.debug('I want to see all fields of a record: '+ a);
Ohhh....so I can't get all field values on a single go.
Thanks for replying.
Assuming this is really important to you, you could do the following
1. Requery the triggered SObject(s) in the trigger using Dynamic SOQL where you construct the fields in the SOQL by going to the SchemaDescribe class
2. Then, if you use system.debug on the queried object(s), you'll get all the fields
A better strategy is to write a utility class that displays the important fields to you and that you can invoke from many places