Skip to main contentSkip to search
Powered by Zoomin Software. For more details please contactZoomin
Progress DocumentationProgress Documentation
Progress Documentation
  • Home
  • Home
  • EnglishČeštinaDeutsch (Germany)Español (Spain)Français (France)Italiano (Italy)Português (Brasil)日本語Русский (Russia)中文 (简体) (China)中文 (繁體, 台灣) (Taiwan)ar-AR
  • Login

Datasets

Handle data-related errors

Save PDF
Save selected topicSave selected topic and subtopicsSave all topics
Share
Share to emailCopy topic URL
Print
Table of Contents
  • Overview of datasets
    • ProDataSets
    • ProDataSet concepts
  • Initial dataset setup
    • Define temp-tables for a dataset
    • Define a dataset
    • Define and attach data-sources
  • Populate a dataset using FILL
    • Use FILL-MODE to control how a dataset is populated
    • Example code to populate a dataset
    • Use FILL-WHERE-STRING to assign queries prior to FILL
    • Cleanup after using a dataset
  • Use datasets in a distributed environment
    • Pass a dataset within the same ABL session
    • Pass a dataset from a client to a server session
    • Minimize overhead when passing a dataset parameter
    • Write ABL client code to retrieve a dataset from the server
  • Update and sync dataset data
    • Update datasets in the client
    • Process dataset updates in the server
    • Merge changes back to the client
    • Complete example of client and server code to update a dataset
  • Handle events with datasets
    • Associate a dataset object with an event handler
    • Dataset FILL events
    • Temp-table buffer FILL events
    • Dataset change events
    • Other dataset events
  • Batch data with datasets
    • Client code to retrieve first batch of data
    • Server code to process batched data
    • Manage batched data in the client
  • Handle errors with datasets
    • Types of dataset errors
    • Handle system-generated errors
    • Handle data-related errors
    • Provide error information to the client
Table of Contents

Handle data-related errors

Save PDF
Save selected topicSave selected topic and subtopicsSave all topics
Share
Share to emailCopy topic URL
Print
  • Last Updated: January 22, 2026
  • 2 minute read
    • OpenEdge
    • Version 12.8
    • Documentation

You may want to detect data-related errors in your server-side application code before an attempt is made to update the database. For example, if a field was changed in the client to a value that is outside the acceptable range of values, you can add code in the server-side application to detect the error. In such a case, you set the REJECTED attribute for a row and set the ERROR attribute at the temp-table and dataset levels. When you set the REJECTED attribute in the server for a row, you always set it for the before-table buffer.

Note: You can use either the ERROR or REJECTED attribute for a row when a data related error is detected. Using REJECTED makes it easier for the client part of the application to differentiate between a system-generated error and a data-related error.

Similar to how MERGE-CHANGES handles rows with the ERROR attribute set, MERGE-CHANGES does not merge rows with the REJECTED attribute set.

Set REJECTED for related records

Depending on your business requirements, when you detect an error in a row you may also want to reject all related child rows and rollback all related changes. For example if an error occurs on a ttOrder row, you would:
  • Set the REJECTED attribute to TRUE for all ttOrderLine rows in the ttOrder.
  • Set the REJECTED attribute to TRUE for the ttOrder row.

In addition, you should set the ERROR attribute for the ttOrderLine and ttOrder temp-tables, and also the dsOrderOrderLine dataset.

The following illustration shows the REJECTED attribute set on child temp-table rows and the ERROR attribute set on the temp-table and dataset.

Set the ERROR and REJECTED attributes in the server

The following is an example in which the application sets the REJECTED attribute to TRUE for the before-table buffer row, if an error occurs when validating the data. The application also sets theERROR attribute to TRUE for the before-table and dataset.

. . .
hQuery:GET-FIRST.
DO WHILE hBeforeBuffer:AVAILABLE:
  /* procedure to validate the data */
  RUN ValidateData(hBuffer, OUTPUT lValid).
  IF lValid
  THEN
    hBeforeBuffer:SAVE-ROW-CHANGES() NO-ERROR.
  ELSE
    ASSIGN
      hBeforeBuffer:REJECTED = TRUE
      hBeforeTable:ERROR = TRUE
      hChangeDataset:ERROR = TRUE.

  hQuery:GET-NEXT.
END.
. . . 
TitleResults for “How to create a CRG?”Also Available inAlert