# 402 - Save Document

> MSS documentation · https://doc.sysdevmobile.com/mss/extensibility/functions-mss-to-kalipso/orders/402-orders-save-document
>
> Eventos EXT_0402 Before/Replace/After ao gravar uma encomenda; o Replace pode cancelar a gravação devolvendo outCanSave.

402 - Save Document

| Event                                          | Extension action set  | Description                                                                                               |
| ---------------------------------------------- | --------------------- | --------------------------------------------------------------------------------------------------------- |
| [Before ](https://doc.sysdevmobile.com/mss/extensibility/functions-mss-to-kalipso/orders/402-orders-save-document.md#before)  | EXT\_0402\_1\_Before  | Will be executed before MSS saves the order;                                                              |
| [Replace](https://doc.sysdevmobile.com/mss/extensibility/functions-mss-to-kalipso/orders/402-orders-save-document.md#replace) | EXT\_0402\_2\_Replace | Will be executed before MSS saves the order with the possibility to say MSS to cancel the saving process; |
| [After](https://doc.sysdevmobile.com/mss/extensibility/functions-mss-to-kalipso/orders/402-orders-save-document.md#after)     | EXT\_0402\_3\_After   | Will be executed after the order 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;
* inCustomerCode – Code of the selected customer;

### Replace

_Input Parameters_

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

_Output Parameters_

* outCanSave – Return code: 1 – Save the document / 0 – Cancel

### After

_Input Parameters_

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