---
url: /flow/guide/scripting-reference/classes/data-set/dataset.cancelpost.md
---

# Dataset.CancelPost

## Declaration

`procedure CancelPost;`

### Example

```pascal
procedure OnMapEvent(var Value:Variant);
begin
  DATASET.Insert; //create new record
DATASET['Field1'].Value := 10;
DATASET.CancelPost; //cancel the creation of a new record
end;
```

## Description

Cancels the creation of a new or edited record from the [Dataset.Insert](/flow/guide/scripting-reference/classes/data-set/dataset.insert) or [Dataset.Edit](/flow/guide/scripting-reference/classes/data-set/dataset.edit) procedure.

If it is a new record it will be lost (not saved), however if you are editing a record then it will revert to its previous values.
