You need to sign in to do that
Don't have an account?
Immu
Test Class for Trigger(I'm New to Test Class)
Hi
Iam New to Test Class...Iam struggling to write Test Class to my Trigger..
Can any one write the test class for below Trigger...
trigger ownershipTrigger on Account (before update) {
Map<Id,Account> mp=new Map<Id,Account>();
mp=trigger.oldMap;
for(account a:trigger.new)
{
Account al=new Account();
al=mp.get(a.Id);
if(a.Ownership!=al.Ownership)
{
a.ownership.adderror('You Cannot Change this Ownership');
}
}
}
Any help would be greatly appreciated..
Hi,
Assuming that 'Name' is only mandatory field on Account, I have written below test class. You can always modify it to get to your business objective.
Hopefully, it will help you!
Happy to help you!
Regards,
Digamber Prasad