# 3202 - Save Document

> MSS documentation · https://doc.sysdevmobile.com/mss/extensibility/functions-mss-to-kalipso/purchases/3202-purchases-save-document
>
> Eventos EXT_3202 ao gravar um documento de compra; o Replace pode cancelar a gravação (outCanSave) e indicar uma transação (outTransactionName).

3202 - Save Document

| Event                                              | Extension action set  | Description                                                                                                 |
| -------------------------------------------------- | --------------------- | ----------------------------------------------------------------------------------------------------------- |
| [Before](https://doc.sysdevmobile.com/mss/extensibility/functions-mss-to-kalipso/purchases/3202-purchases-save-document.md#before)   | EXT\_3202\_1\_Before  | Will be executed before MSS saves the purchase document;                                                    |
| [Replace](https://doc.sysdevmobile.com/mss/extensibility/functions-mss-to-kalipso/purchases/3202-purchases-save-document.md#replace) | EXT\_3202\_2\_Replace | Will be executed before the normal MSS validations of saving the document, with the possibility to cancel; |
| [After](https://doc.sysdevmobile.com/mss/extensibility/functions-mss-to-kalipso/purchases/3202-purchases-save-document.md#after)     | EXT\_3202\_3\_After   | Will be executed after the document is saved;                                                               |

### Before

_Input Parameters_

* inDocumentExercise – Exercise of the document;
* inDocumentType – Type of the document;
* inDocumentSeries – Series of the document;
* inDocumentNumber – Number of the document;
* inSupplierCode – Code of the selected supplier;

### Replace

_Input Parameters_

* inDocumentExercise – Exercise of the document;
* inDocumentType – Type of the document;
* inDocumentSeries – Series of the document;
* inDocumentNumber – Number of the document;
* inSupplierCode – Code of the selected supplier;

_Output Parameters_

* outCanSave – Return code: 1 – Save the document / 0 – Cancel;
* outTransactionName – Name of the transaction to use if changes made inside the extensibility must be rolled back when an error occurs saving the document. Empty if not used.

### After

_Input Parameters_

* inDocumentExercise – Exercise of the document;
* inDocumentType – Type of the document;
* inDocumentSeries – Series of the document;
* inDocumentNumber – Number of the document;
* inSupplierCode – Code of the selected supplier;
