0

I have a flow which creates order and order line items from quote and quote line items if approved by manager. Once order and order line items are created i want to avoid creation, update and delete of order and order line items. I am using validation rules to achieve this but it is restricting flow as well to create new records. So basically i want only flow to create records nothing else.

closed as off-topic by Sebastian Kessel, Vijay Ganji, glls, Mohith Shrivastava, Pranay Jaiswal Jul 5 at 12:56

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "Questions on problems in code you've written must describe the specific problem and include valid code to reproduce it. For help writing short, self-contained syntactically-valid examples, see: SSCCE.org" – Sebastian Kessel, Vijay Ganji, glls, Mohith Shrivastava, Pranay Jaiswal
If this question can be reworded to fit the rules in the help center, please edit the question.

2

You cannot restrict record deletion (other than by removing the object-level permission from the affected users) without a trigger, save by a clumsy indirection. If you establish a rollup field on the parent object, such as a COUNT() of the child objects you don't want to be deleted, you can write validation rules on the parent to prohibit changes and thereby fail any transaction that attempts to delete a child object.

However, this only works if you have a master-detail relationship and can define the criteria for the situation where deletion is not allowed in terms of fields on the parent object, which sounds like it is not the case here.

So to restrict deletion, you need to either change object permissions, or write a trigger, full stop.

To restrict other operations so that they're only achievable by automation, a common recommendation that you'll find in numerous examples if you search SFSE is to write a validation rule to require that any change to the object must modify (ISCHANGED()) a specific hidden field, on that's not shown on the page layout. The Process or Flow can modify that field to allow its changes to go through, but the user cannot.

Not the answer you're looking for? Browse other questions tagged or ask your own question.