Newer Version Available
LockResult Class
Namespace
Usage
Example
The following example obtains and iterates through the returned Approval.LockResult objects. It locks some queried accounts using Approval.lock with a false second parameter to allow partial processing of records on failure. Next, it iterates through the results to determine whether the operation was successful for each record. It writes the ID of every record that was processed successfully to the debug log, or writes error messages and failed fields of the failed records.
LockResult Methods
The following are methods for LockResult.
getErrors()
Signature
public List<Database.Error> getErrors()
Return Value
Type: List<Database.Error>
getId()
Signature
public Id getId()
Return Value
Type: Id
Usage
If the field contains a value, the object was locked. If the field is empty, the operation was not successful.
isSuccess()
Signature
public Boolean isSuccess()
Return Value
Type: Boolean