BUSINESS TOOLS BLOG

September 29, 2015

Understanding Longer Apex Errors in Salesforce

Filed under: Financial Management — Sandi Mays @ 8:28 am

Understanding Longer Apex Errors can be challenging.

Overview
Some errors are more lengthy and complex in Salesforce because of how the system generates them. They can be confusing because:
1) There is more text to read through before seeing the actual error.
2) The error is usually for a different record than the one you are looking at. For example, you may be attempting to make a change to a Service Order, but Salesforce is alerting you to an issue with a Location linked to that Service Order.

How to Find the Actual Error
Read through until you get a complete sentence that resembles an error you might see elsewhere in Salesforce. In this example error, we have bolded the actual error text to make it easier to see. The error text is “Floor and either Suite, Room, or Cage are required for this Location.”

Description: Error:Apex trigger ServiceOrderStageTransition caused an unexpected exception, contact your administrator: ServiceOrderStageTransition: execution of AfterUpdate caused by: System.DmlException: Update failed. First exception on row 0 with id a0b60000000UxQIAA0; first error: FIELD_CUSTOM_VALIDATION_

EXCEPTION, Floor and either Suite, Room, or Cage are required for this Location.: []: Class.ServiceOrderManager.TransitionStage: line 1493, column 1

What Record Has the Problem?
Locate the 18-digit Salesforce ID that is usually in the middle of the error. Copy that ID onto the end of the following address and paste the entire thing into your browser. Click go to get directly to the record that needs correction.

https://na4.salesforce.com/

Example:
Description: Error:Apex trigger ServiceOrderStageTransition caused an unexpected exception, contact your administrator: ServiceOrderStageTransition: execution of AfterUpdate caused by: System.DmlException: Update failed. First exception on row 0 with id a0b60000000UxQIAA0; first error: FIELD_CUSTOM_VALIDATION_

EXCEPTION, Floor and either Suite, Room, or Cage are required for this Location.: []: Class.ServiceOrderManager.TransitionStage: line 1493, column 1

The link to go directly to this record is:
https://na4.salesforce.com/a0b60000000UxQIAA0

How To Resolve the Error
Once you are at the record that needs correction, make the change that the error message stated. Save the record. Now try the change you original made again and the long complex error should no longer pop up. If the error persists, please open a ticket with your Salesforce Support Team.

No Comments »

No comments yet.

RSS feed for comments on this post. TrackBack URL

Leave a comment

Powered by WordPress