# 520 - Lots validation

> MSS documentation · https://doc.sysdevmobile.com/mss/extensibility/functions-mss-to-kalipso/sales/520-sales-lots-validation
>
> Evento EXT_0520_2_Replace nas vendas, antes da validação normal de lotes do MSS; devolve outCanSave para deixar ou não gravar.

520 - Lots validation

| Event                                          | Extension action set  | Description                                                                                           |
| ---------------------------------------------- | --------------------- | ----------------------------------------------------------------------------------------------------- |
| Before                                         | _not yet implemented_ | ...                                                                                                   |
| [Replace](https://doc.sysdevmobile.com/mss/extensibility/functions-mss-to-kalipso/sales/520-sales-lots-validation.md#replace) | EXT\_0520\_2\_Replace | Will be executed before the normal MSS validations of lots, with the possibility to cancel the save; |
| After                                          | _not yet implemented_ | ...                                                                                                   |

### Replace

_Input Parameters_

* inDocumentType – Type of the document;
* inCustomerCode – Code of the selected customer;
* inLineNumber – Number of the line;
* inLotsInformation – Lots of the line, one lot per row (rows separated by ENTER), each row in the format `LOT + TAB + DAT + TAB + DTV + TAB + QTD`;

_Output Parameters_

* outCanSave – Return code: 1 – Can save / 0 – Can't save (the normal MSS validation of lots is canceled);
