JSDO properties, methods, and events reference : getErrorString( ) method
  

getErrorString( ) method

Returns any before-image error string in the data of a record object referenced in JSDO memory that was set as the result of a resource Create, Update, Delete, or Submit operation.
If there is no error string in the data of the specified record object, this method returns undefined.
Note: This error string can be returned from an OpenEdge Data Object resource that supports before-imaging by setting both the ABL ERROR and ERROR-STRING attributes on a buffer object handle set to the corresponding record in the corresponding ABL temp-table. For more information on these attributes, see OpenEdge Development: ABL Reference and OpenEdge Development: ProDataSets.
The specified record object can be either the working record of a referenced table, or any record provided by a JSRecord object.
Return type: string
Applies to: progress.data.JSRecord class, progress.data.JSDO class, table reference property (JSDO class)

Syntax

jsrecord-ref.getErrorString ( )
jsdo-ref.getErrorString ( )
jsdo-ref.table-ref.getErrorString ( )
jsrecord-ref
A reference to a JSRecord object for a table record in JSDO memory.
You can obtain a JSRecord object by:
*Invoking a JSDO method that returns record objects from a JSDO table reference (find( ), findById( ), or foreach( ))
*Accessing the record property on a JSDO table reference that already has a working record.
*Accessing the record parameter passed to the callback of a JSDO afterCreate, afterDelete, or afterDelete event.
*Accessing each record object provided by the jsrecords property on the request object parameter passed to the callback of a JSDO afterSaveChanges event, or passed to the callback of any Promise object returned from the saveChanges( ) method. The jsrecords property is only available on completion of a Submit operation (saveChanges(true)) on a resource that supports before-imaging, and not if the resource supports before-imaging without Submit.
jsdo-ref
A reference to the JSDO. You can call the method on jsdo-ref if the JSDO has only a single table reference, and that table reference has a working record.
table-ref
A table reference on the JSDO that has a working record.
The error string returned by this function contains error information only for a Data Object Service operation on a resource that supports before-imaging. This information can only be returned for a resource Create, Update, Delete, or Submit operation (saveChanges(true)) that affects the before-image data of a resource record. The JSDO stores the error information from each affected resource record in the corresponding JSDO record object as an internal property of its data with a reserved name.
Note: This method is most useful when the autoApplyChanges property is false. When autoApplyChanges is true, the method automatically accepts or rejects record changes, and clears all associated error conditions and information after the final after* event is fired and handled (if handled) for a given operation.

See also:

addRecords( ) method, afterCreate event, afterDelete event, afterUpdate event, autoApplyChanges property, find( ) method, findById( ) method, foreach( ) method, saveChanges( ) method, record property