Error Class
Represents information about an error that occurred during a DML operation when using a Database method.
Error class is part of SaveResult, which is generated when a user attempts to save a Salesforce record.
See Also
The following are methods for Error. All are instance methods.
-
Returns an array of one or more field names. Identifies which fields in the object, if any, affected the error condition.
-
Returns the error message text.
-
Returns a code that characterizes the error.
Returns an array of one or more field names. Identifies which fields in the object, if any, affected the error condition.
public String[] getFields()
Type: String[]
Returns the error message text.
public String getMessage()
Type: String
Returns a code that characterizes the error.
public StatusCode getStatusCode()
Type: StatusCode
The full list of status codes is available in the WSDL file for your organization (see Downloading Salesforce WSDLs and Client Authentication Certificates in the Salesforce online help.)