You need to sign in to do that
Don't have an account?
bhagya manshani
Send Email Before AddError ..........Please help
Messaging.SingleEmailMessage mail = new Messaging.SingleEmailMessage();
String[] toAddresses = new String[] {'bhagchand.manshani@infostretch.com'};
mail.setToAddresses(toAddresses);
mail.setSubject('Qmetry Instance Already Exist......');
mail.setUseSignature(false);
String Msg='Here are the Following Details';
mail.setHtmlBody(Msg);
System.debug('Final Message '+msg);
Messaging.sendEmail(new Messaging.SingleEmailMessage[] { mail });
// Email Part End Here
// Trigger.old[0].addError('metry Instance Already Exist flag value.'); // Not Working
//lead.Company.addError('Qmetry Instance Already Exist flag value ....... '); // Not Working
// Trigger.oldMap.get(lead.Company).addError('metry Instance Already Exist flag value.'); // Not Working
Please Help Thanks in Adv.
Hi
Your post seems to lack a few essential must knows:
- what is the trigger type you are using Before/Update, insert/Update.
- also the actual exception/error you are getting you are getting.
, also you cannot use addError() with an instance of Trigger.old, plus trigger.old is not available with after/before insert triggers.
Hope this info helps...
may be this can help you
Trigger.new.yourFields__c.addError('bad');