You need to sign in to do that
Don't have an account?
sunny.kapoor1306
Trigger difference
Can anyone tell me the proper difference b/w trigger.old and trigger.new with eg's?
I dont want the help n training explanation
function readOnly(count){ }
You need to sign in to do that
Don't have an account?
Can anyone tell me the proper difference b/w trigger.old and trigger.new with eg's?
I dont want the help n training explanation
Hi,
Conside the below EG: of Account
Suppose you are having the following record:
Account Name = 'TestAccountOld';
So now if you update the recordName to say:
Account Name = 'TestAccountNew';
So trigger.new will return a list with the new value of Account i.e:
Account Name = 'TestAccountNew';
And trigger.old will return you the old value of that Account i.e:
Account Name = 'TestAccountOld';
Let me know if it works for you!
Thanks
I understood the difference
is the coding same?
Yes, you will mostly be using the trigger.old in update and delete case.
Try working with one example you will understand the difference yourself.
Also mark it as a solution if it solves your problem!
I wrote a code for trigger.new
can i convert this into .old?
trigger titletext on Lead (before insert,before update) {
for(Lead e:trigger.new)
if(e.title==null)
{
e.title='Miscellenous';
e.industry='Bollywood';
}
}
No. Trigger.new and trigger.old are the list of records provided to you by the trigger itself with trigger.new consisting of the new values and trigger.old consisting of the old values(prior to the change).
If you can mention your requirement clearly it would help me better in helping you!
sure sir
actually i just want a working eg of trigger.old which wud help me understand better