Skip to content Skip to main navigation Skip to footer

User create invoice permission but can’t edit

If you have a process like a flow that is creating an invoice, and that user has been given permission to create an invoice but not edit it, lets say a Guest User, then you might see an error like this when creating the invoice:

This error occurred when the flow tried to create records:
CANNOT_INSERT_UPDATE_ACTIVATE_ENTITY: opay.InvoiceChargeCustomerOnFile:
execution of AfterInsert caused by: System.SecurityException: Not allowed
to update object Invoice (opay).

This is because Opero Payments app is performing an update to every invoice after it is created to update the Invoice.EncodedId field with a value. This field creates the unique id used in payment links and must be created after invoice is inserted.

As a work around you can provide the permission via the profile or permission set to the user that allows them to update the Invoice, but only to update the Invoice.EncodedId field and no other fields. Then we would suggest also removing this field from the page layout for this user profile.

0 Comments

There are no comments yet

Leave a comment

Your email address will not be published. Required fields are marked *