Restricting Updates to "Locked" Invoices via workflows
Collapse
X
-
The easiest way is to create a beforeSave hook for the Invoice entity type.
PHP Code:if ($entity->get('isLocked') && !$entity->isAttributeChanged('isLocked')) {
throw new \Espo\Core\Exceptions\Conflict("Cannot change locked record.");
}
https://docs.espocrm.com/development/hooks/👍 2 -
Restricting Updates to "Locked" Invoices via workflows
Hi,
Currently, when an Invoice is "Locked", it cannot be edited via the UI. However, it is still possible to update an Item in a "Locked" Invoice using workflows or custom hooks.
Is there a way to completely prevent any updates to a "Locked" Invoice or its Items through the system itself, without relying on the "isLocked" parameter?
This would prevent unauthorized changes, as workflow reports might contain errors, such as missing the "isLocked" parameter or setting it incorrectly.Tags: None
Leave a comment: