You need to sign in to do that
Don't have an account?
Sudhakar Reddy
Triggers
Please explain me what is trigger.old ?
i amnot expecting definition.I am expecting explanation with example.
function readOnly(count){ }
You need to sign in to do that
Don't have an account?
Please explain me what is trigger.old ?
i amnot expecting definition.I am expecting explanation with example.
Hi
for eg:
in trigger when u r goign to inset account record and update
then u can put see previous or old value is which is insert(test) and new value is (post)
Account acc = new account();
acc.name='test';
insert acc;
acc.name='post';
update acc
system.debug(trigger.OldMap.get(acc.Id).name);
Regards,
Rajesh.
Trigger.old is one kind of generic map kind of functionality.
You can hold the vales in map as well as in list also.
Example you written one trigger which works on Contact after update
suppose contact objContact = new contact();
objContact.Name = test'';
insert objContact;
objContact.Name = test123389465'';
update objContact;
if you ask the trigger.old vale then it will give us the vale which are before fireing the trigger.
it mesas in the above case trigger.old value says the contact.name is test
and trigger.new vale says the contact.name is test123389465
Regards,
Shreyaaa