Reputation: 87
Any approaches to prevent invoiceproducts from being deleted? And pros and cons of these approaches.
Thanks in advance
Upvotes: 0
Views: 317
Reputation: 23300
InvoiceDetails
share permissions with Invoice
(same is true for Quote
and SalesOrder
), so it most likely wouldn't work for you. Also, a System Administrator
wouldn't be stopped.
A script would not be involved when interacting from SDK.
Hiding buttons doesn't help either (what if a workflow is built to perform the operation ?)
The "best" (as in: what we found out being the most hassle-free approach to this) way to do this would be a plugin.
Pre-Operation, Synchronous, should always work as you need (you might want to only allow deletion under specific circumstances, just to name one possible scenario).
Also, a plugin approach would cover data manipulation no matter what (from CRM UI, from mobile, from SDK code ...).
Upvotes: 1
Reputation: 15128
If a security role based solution is enough, managing the permissions is the preferred way to go.
If for the deletion other factors are considered (for example team membership or properties of the product) a plugin it's necessary.
Hiding ribbon buttons is useless, because most of the times the same action (in this case delete an invoice product) can be done in different ways (for example from an advanced find result)
Upvotes: 1