# 501 - Save Document

> Syslog 4.0 documentation · https://doc.sysdevmobile.com/syslog/extensibility/inventory/501-inventory-save-document
>
> Função 501 do inventário: ações EXT_0501 para validar, substituir ou complementar a gravação do documento em inventário assistido ou cego.

501 - (Inventory) Save Document

| **Event**                                         | **Extension action set** | **Description**                                                                                                                    |
| ------------------------------------------------- | ------------------------ | ---------------------------------------------------------------------------------------------------------------------------------- |
| [Before ](https://doc.sysdevmobile.com/syslog/extensibility/inventory/501-inventory-save-document.md#before)  | EXT\_0501\_1\_Before     | Will be executed before save the document;                                                                                         |
| [Replace](https://doc.sysdevmobile.com/syslog/extensibility/inventory/501-inventory-save-document.md#replace) | EXT\_0501\_2\_Replace    | Will be executed before Syslog APP saves the inventory document with the possibility to say Syslog APP to cancel the saving process; |
| [After](https://doc.sysdevmobile.com/syslog/extensibility/inventory/501-inventory-save-document.md#after)     | EXT\_0501\_3\_After      | Will be executed after the document is saved;                                                                                      |

### Before

_Input Parameters_

* inCabKey – Unique key of the document; (assisted inventory)
* inInternalStamp - Internal key of the document (blind inventory);

_Output Parameters_

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

### Replace

_Input Parameters_

* inCabKey – Unique key of the document; (assisted inventory)
* inInternalStamp - Internal key of the document (blind inventory);
* inWarehouse – Warehouse
* inZone – Zone
* inLocation - Location

_Output Parameters_

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

### After

_Input Parameters_

* inCabKey – Unique key of the document; (assisted inventory);
* inInternalStamp - Internal key of the document (blind inventory);
* inFilterCabDoc - Unique key of the document;
* inErroIntegracao - Return code:
  * 0 - no Error
  * 1 - Error saving
* inStampDocGerado - Generated document;
