user900168
user900168

Reputation: 87

Crm2011:How to restrict deleting invoice-product

Any approaches to prevent invoiceproducts from being deleted? And pros and cons of these approaches.

  1. Plugin: capture deleting invoiceproducts request.
  2. UI script: Disable "Delete Invoice Product" button on the 'Invoice Products' button.
  3. Permissions: set up permissions for InvoiceProducts like other system entities.

Thanks in advance

Upvotes: 0

Views: 317

Answers (2)

Alex
Alex

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

Guido Preite
Guido Preite

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

Related Questions