You need to sign in to do that
Don't have an account?
Vishvesh Bhandari
Capturing errors without try catch.
Hi,
Could anyone help me on how to capture errors after using Database DML methods in Salesforce instead of using try/catch methods?
Thanks
Vishvesh.
Could anyone help me on how to capture errors after using Database DML methods in Salesforce instead of using try/catch methods?
Thanks
Vishvesh.
You can use getError() to see what errors have occurred.
getErrors()-: If an error occurred, returns an array of one or more database error objects providing the error code and description. If no error occurred, returns an empty set.
Refer to https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_methods_system_database_saveresult.htm
Mark it as solved if it helps.
Shubham Nandwana
AppPerfect Corp.
salesforce@appperfect.com
408-252-4100
http://www.appperfect.com/services/salesforce/
Salesforce Development & Operations Experts
All Answers
You can use database methods instead.
Refer below link.
https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/langCon_apex_dml_database.htm
Best Regards,
Sandhya
You can use getError() to see what errors have occurred.
getErrors()-: If an error occurred, returns an array of one or more database error objects providing the error code and description. If no error occurred, returns an empty set.
Refer to https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_methods_system_database_saveresult.htm
Mark it as solved if it helps.
Shubham Nandwana
AppPerfect Corp.
salesforce@appperfect.com
408-252-4100
http://www.appperfect.com/services/salesforce/
Salesforce Development & Operations Experts