How to check whether which line got compile error?

Following code will show error message as well as the line which contains the error message.

 
try {
//Your Code
} catch(Exception e) {
Apexpages.addMessage(new Apexpages.Message(Apexpages.severity.ERROR, e.getMessage() + '***' + e.getStackTraceString()));
}

Published by Sandeep Kumar

He is a Salesforce Certified Application Architect having 11+ years of experience in Salesforce.

Leave a Reply